XML tags for multiple lines

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
pieter
Posts: 1
Joined: Fri Sep 10, 2004 1:26 am
Contact:

XML tags for multiple lines

Post by pieter »

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:
References:
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>...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?

thanks
Pieter Zanstra
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post by DataMystic Support »

Hi Pieter,

Try EasyPattern

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

Replace with

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

Or just add a new left/right margin.
Post Reply