Hi ,
I have a XML output file in one string as below
"<student><Firstname>mike</firstname><lastname>brown</lastname></student><student><Firstname>rob</firstname><lastname>donty</lastname></student>"
I need to split the above file on basis of parent tag i.e. <Student> and have the o/p in below format i.e. for each record one row.
Row1<student><Firstname>mike</firstname><lastname>brown</lastname></student>
Row2<student><Firstname>rob</firstname><lastname>donty</lastname></student>
Thanks in Advance for help
Regards,
Munish
XML File split
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
You might have trouble reading this in DataStage if it is a large file. You are on Unix so the easiest way would be a Unix awk command that adds and end of line character to the end of the </STUDENT> string. Can't tell you the exact command, don't know awk that well.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 84
- Joined: Thu Dec 04, 2003 9:55 pm
I guess you must have the XML Input/output stage installed on your system, Once you have the file Use the XML Metadata Importer and Import the Table Definition for the file and then you could use the XML Output stage to retive the values by passing the appropriate parameters.
Hope this helps.
Thanks & Regards
Mahesh
Hope this helps.
Thanks & Regards
Mahesh
Thanks to all , it solved the problem by pasing the dta thro' the XML writer.
Regards
[quote="MaheshKumar Sugunaraj"]I guess you must have the XML Input/output stage installed on your system, Once you have the file Use the XML Metadata Importer and Import the Table Definition for the file and then you could use the XML Output stage to retive the values by passing the appropriate parameters.
Hope this helps.
Thanks & Regards
Mahesh[/quote]
Regards
[quote="MaheshKumar Sugunaraj"]I guess you must have the XML Input/output stage installed on your system, Once you have the file Use the XML Metadata Importer and Import the Table Definition for the file and then you could use the XML Output stage to retive the values by passing the appropriate parameters.
Hope this helps.
Thanks & Regards
Mahesh[/quote]