Extract line from XML files and combine into one CSV file

Get help with installation and running here.

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

Post Reply
jolint
Posts: 1
Joined: Wed Apr 16, 2008 11:55 pm

Extract line from XML files and combine into one CSV file

Post 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.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Post 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
Post Reply