• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Batch program - CSV/XML input file

 
Piyush Mattoo
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a batch job written in Java which accepts data in the form of files in CSV format. Would it be better to have data coming in XML format since then we can have a schema to maintain consistency across dataset and validate the data against the schema. Do we have any such facility in CSV file format?
Also, is there any way to continue accepting files in CSV format and convert them over to XML at our end? Any good practices around that?

Thanks in advance!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can transform your data any way you want once you have it. As an example, we get files from clients in maybe 2-3 dozen CSV layouts. We have a process that converts each format into standard XML we then feed into our back end. There are a zillion ways to do this, including commercial products.
 
Piyush Mattoo
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David for the response.
Our batch processes run once a day and i would imagine this conversion process would also happen then once a day sometime before the loader executes. Any recommendation for using any tool for doing the conversion in an automated manner?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not really; we use a commercial product for most, and hand-craft a few for the oddballs, with a DSL defining the conversions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic