February 28th, 2007, 06:10 PM
Looking for a samaritan
I have a problem and hope someone can help.
I have an XML document and need to extract the data from it .
The ideal solution would be for the data within the XML to be extracted and inputed into a excell spreadsheet. As I receive several XML documents a day I would Ideally like each extraction to be added after the next ( ie I extract xml document A and it puts into a spreadsheet , then when I extract XML document B the data from then is extracted and added below the data from document A and so on).
I believe this should be pretty easy and simple for a coder , if anyone can write the needed code for me , I would be ever so gratefull as I don't know how to program. Any language would be fine.
If anyone is willing to give it a go then please PM me,
February 28th, 2007, 10:28 PM
Once again some more questions:
1. Do you want the entire document, or just parts of it? (fields)
2. Are the documents all of the same length and format?
3. Can you provide two examples.......they don't have to be real, just realistic as to data type (numeric, alpha, alphanumeric) and length/layout.
The solution might be as simple as just importing them into Excel/Access or writing an update query. Sometimes you can do this with just the native GUI, otherwise there is a bit of VBS "tuning" required (yeah, I know......redundant, but I didn't develop MS office )
If you cannot do someone any good: don't do them any harm....
As long as you did this to one of these, the least of my little ones............you did it unto Me.
What profiteth a man if he gains the entire World at the expense of his immortal soul?
March 1st, 2007, 09:46 AM
last time I did anything to do with coding for XML I ended up using c#. It has some nice libraries for dealing with XML.
easiest output would just be to a CSV file, easy to append to and openable in excel. Of course, if you want to take this data and do excel stuff to it you can't save it in CSV format.
An easier option might be make something that converts your XML to CSV and then copy and paste to the bottom of your existing document.
</my two pence>
If the world doesn't stop annoying me I will name my kids ";DROP DATABASE;" and get revenge.
March 2nd, 2007, 09:27 PM
I've got an XML-to-CSV php class (for a virtually tabular XML format) floating around somewhere, along with a "combine CSVs" script. Would those help?
They're scars from fighting with a Multiple Listing Service data feed. At least it wasn't biomedical data. <shiver>
Last edited by Terr; March 2nd, 2007 at 09:30 PM.
[HvC]Terr: L33T Technical Proficiency
March 5th, 2007, 01:42 PM
Here is a page with a VBS script that nearly does what you want. Warning I havn't tested the script so be carefull about using it. http://www.codeproject.com/vbscript/xml2csv.asp . I would sugest you check out microsoft script page for other examples if you want to go with VBS.
Last edited by MURACU; March 5th, 2007 at 01:45 PM.
\"America is the only country that went from barbarism to decadence without civilization in between.\"
\"The reason we are so pleased to find other people\'s secrets is that it distracts public attention from our own.\"