I am planning to request the users of the my web application to submit bulk data in the following format.
BatchID:1
TotalRecords:200
Cust:CustID~FirstName~LastName~Age~Dob~City~State~Country
1~John~Abraham~35~10/10/1974~New York~NY~US
Order:OrderID~CustID~Qty~Amount~DOS
1~1~10~100.00~1/1/2012
2~1~100~1000.00~1/1/2012
1~1~10~100.00~1/1/2012
OrderDet:OrderDetID~OrderID~Reg1~Remarks
1~1~12393A~Testing order
2~1~23123B~tesitng order 1
Above shown is just a set of records. One flat file will have upto 200 files.
Do you think this is a right way of doing it? We need to allow batch upload so that users need not enter each record at a time from the website.
If you can think of any other format that will be of great help
XML with a defined schema would be a nice choice.
A couple problems offhand with your format:
There are well known XML tools to help with validating what the user is uploading. It’s worth considering…
I’m not a huge fan of CSV but at least there are well known tools to work with it. however, as I recall there is some variation in the CSV formats. For example, How to escape the comma? Is it by putting the string field in double quotes eg. “My first, second, third” etc. Is it by using
\,? etc.