Page 1 of 1

XML to XLS - how to.

Posted: Thu Jun 12, 2008 8:01 pm
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

Re: XML to XLS - how to.

Posted: Wed Jun 18, 2008 7:56 am
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.