on 04-11-2017 3:09 PM
Dear Experts,
I’m expecting a XML structure as output for my CSV input. However I’m getting XML structure whereas the line items in sub-hierarchy are missing.
Please read the below explanation for further information.
Please correct me if the CSV input I’ve given is incorrect.
All helpful replies will be appreciated.
Explanation:
Working in HCI on a iflow, in which input is a CSV file. So in the iflow, i put a SFTP server to get the file, then a converter step for CSV to XML converter.
In the csv file, the data is something like:
Header 1 2 3
LineItems 12 3 4
LineItems 12 3 4
Header 1 2 3
LineItems 12 3 4
LineItems 12 3 4
Meaning multiple records header and Line items is sub hierarchy.
Created XSD for the above XML manually or from online tool like freeformatter.com and I can see the structure of the file in hierarchy as:
Then imported that XSD in the integration project in HCI where the above iflow is created.
Then path to target element in XSD : /root/row
Record marker in csv - empty
Field separator in csv – comma
Regards,
Md Thouheed.
Hello Mohammad,
Please find the below.
http://opencsv.sourceforge.net/apidocs/help-doc.html
http://opencsv.sourceforge.net/apidocs/
http://opencsv.sourceforge.net/apidocs/
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sriprasad,
Can you please send me few links to understand open CSV.
I will try to get help to work on groovy srcipt.
Thanks for your time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mohammad ,
Its not possible to generate the output in the format you have given using Standard CSV to XML convertor.
You have to write Groovy Script to achieve the same[ You can use freely available package like OpenCSV ].
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mohammed,
It would be great if you can mention some logical input(CSV where we can differentiate fields and lines ),expected output(try to put the values from CSV mentioned) and what output you are currently getting.
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.