Page 1 of 1

Extract line from XML files and combine into one CSV file

Posted: Thu Apr 17, 2008 12:01 am
by jolint
Hi,

I need to extract a line in the form of <value> ... </value> from an XML file in a set of XML files (in a sub-directory structure).

Then place the filename of each XML file & the corrosponding values into a CSV file, one row for each XML filename.

Any ideas?

Thanks.

Re: Extract line from XML files and combine into one CSV file

Posted: Thu Apr 17, 2008 11:48 am
by DataMystic Support
Easy, use a perl search/replace pattern with Extract Option turned on.

Search for:

Code: Select all

<value>(.*)</value>
Replace with:

Code: Select all

"@fullInputFilename","$1"\r\n
and ensure you use the output filter option to send all output to a single file