XML to XLS - how to.

Get help with installation and running here.

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

Post Reply
simicar
Posts: 5
Joined: Thu Feb 15, 2007 7:25 am

XML to XLS - how to.

Post by simicar »

Hi.

I've got two questions. I'm dealing with converting dosen of XML files
to one XLS performing a "Find pattern (perl)" function with simple code

Code: Select all

<TAG dsK="sth" nrW="sth">(.*)</TAG>

replace to

$1;\r\n
[x] extract matches (which covers only one column of data)

All I need is to get an Excel XLS (could be CSV insead, doesn't really bother) BUT,
when using two same Find pattern functions, I get void respnse.
When trying to pile up several tags in one function like:

Code: Select all

<TAG1 dsK="sth" nrW="sth">(.*)</TAG1>(.*)<TAG2 dsK="sth" nrW="sth">(.*)</TAG2>

replace to

$1;$3;\r\n
[x] extract matches - get void response either.

Is there a solution to this? Maybe diffrent option or other code?

The second case reffers to the @inputfilename.
I've read here: viewtopic.php?f=17&t=555&p=1481&hilit=i ... name#p1481
that using it with find function is
"...not working because @inputFilename and other macros can't be used in the search string (for efficiency reasons)."
so, how to get the name of the xml file as a first column to get a:

"filename";"xml-val1";"xml-val2";"xml-val3";"xml-val4";"xml-val5";\r\n replace pattern?

Thanks in advance for the two solutions
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: XML to XLS - how to.

Post by DataMystic Support »

You can use @inputFilename in the REPLACE string, just not in the find pattern.

Code: Select all

<TAG1 dsK="sth" nrW="sth">(.*)</TAG1>(.*)<TAG2 dsK="sth" nrW="sth">(.*)</TAG2>
Looks fine - but what is your source data? Emailing us your filter with Trial Run text would help.
Post Reply