I want to seprate the field from csv file but thing is that field itself content commas so how to go for it
for example
supid, suppliername, city, state, phone no
1, Orton Eng, mumbai, maharashtra, 02228695877,02228692356
here i have two phone nos with commas
thanks in advance
Loading
VulpesPosted Jun 18, 2011, 1:21 PM
Sam HobbsPosted Jun 19, 2011, 8:59 PM
If the format of the input data can be modified then I suggest using a different delimiter other than a comma. The most common alternate is the tab ('\t') which will likely work here since the data won't have tabs. If the data might have tabs then there are many other possibilities. See Escape Sequences and the ASCII Character Codes Chart for other possibilities. A backslash ('\\') is another character that is not likely to be in most text. So in other words, just separate the fields with a delimiter (such as a tab character) instead of a comma and then you don't need to add the quotes; the data can be parsed with just a simple split.
VulpesPosted Jun 19, 2011, 3:18 PM
Sam HobbsPosted Jun 19, 2011, 2:34 PM
VulpesPosted Jun 19, 2011, 2:08 PM
AmolPosted Jun 19, 2011, 1:18 PM
Sam HobbsPosted Jun 19, 2011, 4:37 AM
AmolPosted Jun 19, 2011, 12:26 AM
keep it up..