Split string problem
Posted: Fri Aug 07, 2009 3:47 am
I am trying to get my website capable of importing data from anouther program. Hence the data itself can not be changed.
Most lines of the file import are of the format
I can remove the " and split by , and then sort it into my database happily. However some people save the names with a , in them e.g.
Now when i split the string i have an extra element which means the database wouldn;t store correctly (in fact it hits a failsafe check and doesn't get tried.
What i need is a method to split the string into an array correctly. I cannot split by "," due to the numbers not containing "".
What would be the best way to split the above strings into the same array of 23 length?
Most lines of the file import are of the format
Code: Select all
"10000","Mr Anybody","AnyBusiness","ARoad","ATown","ACounty","AN1 1AN","Mr Any body","01708 766223","01708 737329","","","",0,"",0.00,0.00,0.00,500.00,"14",0,0.00,"4000","T1"Code: Select all
"10000","Mr Anybody","AnyBusiness","ARoad","ATown","ACounty","AN1 1AN",[color=#BF0000]"Mr body, Any"[/color],"01708 766223","01708 737329","","","",0,"",0.00,0.00,0.00,500.00,"14",0,0.00,"4000","T1"What i need is a method to split the string into an array correctly. I cannot split by "," due to the numbers not containing "".
What would be the best way to split the above strings into the same array of 23 length?