W
writebrent
I wrote a little interface for users to post data to a website. On
their local machines, it produces CSV from an Excel spreadsheet, then
posts it to the site. In some cases, the CSV will contain ampersands.
For example,
abc,American & British Company,1,4.34,5
ded,Dog Eat Dog,2,6.3,5.766
The code on the site is pretty standard: it loops through an array of
lines from the CSV split on line ends, and then loops through another
array of data created from splitting each line on the comma.
Easy.
But, for some reason, when it encounters "&", the code breaks down and
ignore the rest of the line. So, I get an "Index out of bounds" error.
To fix it, I stripped the "&" character, and all runs well. But I'd
rather keep it in. If you've any hints how to fix this (simple?) error,
I'd appreciate your help.
Thanks.
--Brent
their local machines, it produces CSV from an Excel spreadsheet, then
posts it to the site. In some cases, the CSV will contain ampersands.
For example,
abc,American & British Company,1,4.34,5
ded,Dog Eat Dog,2,6.3,5.766
The code on the site is pretty standard: it loops through an array of
lines from the CSV split on line ends, and then loops through another
array of data created from splitting each line on the comma.
Easy.
But, for some reason, when it encounters "&", the code breaks down and
ignore the rest of the line. So, I get an "Index out of bounds" error.
To fix it, I stripped the "&" character, and all runs well. But I'd
rather keep it in. If you've any hints how to fix this (simple?) error,
I'd appreciate your help.
Thanks.
--Brent