XML tags for multiple lines

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

Posts: 1
Joined: Fri Sep 10, 2004 1:26 am

XML tags for multiple lines

Postby pieter » Fri Sep 10, 2004 1:37 am

I have asked this before directly to Simon, but the answer has disappeared in Cyberspace. Probably it is better to post it here in the interest of the general public. My problem is the following. I have an input file like:
Author1, title1.
Author2, title2.
Author_n, title_n.
<empty line>
This needs to be tagged in XML like
<reference>Author1, title1.</reference>
<reference>Author2, title2.</reference>
<reference>Author_n, title_n.</reference>

How do I grasp this repetition of lines in a regular expression if I do not know beforehand how many lines I may expect after the first line with 'References:' Or do I need to write some VB?

Pieter Zanstra

User avatar
DataMystic Support
Site Admin
Posts: 2140
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia

Postby DataMystic Support » Fri Sep 10, 2004 5:16 pm

Hi Pieter,

Try EasyPattern

[ capture(csvfield), ',' , capture(csvfield) ]

Replace with

<reference>$1, $2</reference>

Or just add a new left/right margin.

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Google [Bot] and 2 guests