SkyHog
Touchdown! Greaser!
- Joined
- Feb 23, 2005
- Messages
- 18,431
- Location
- Castle Rock, CO
- Display Name
Display name:
Everything Offends Me
I am parsing through a CSV that I have no control over (can't change the format, period).
In this CSV, I pull data out of certain fields. Unfortunately, every once in a while, one of those fields has a comma in it, and it jacks the whole thing up. I can't change the format of it to ensure that each value is in quotes, nor change it to a tab delimited or "ASSAASDSADS" delimited file.
Ideas on how I can programmatically detect that a field contains commas and treat them all the same? An example is below:
In this CSV, I pull data out of certain fields. Unfortunately, every once in a while, one of those fields has a comma in it, and it jacks the whole thing up. I can't change the format of it to ensure that each value is in quotes, nor change it to a tab delimited or "ASSAASDSADS" delimited file.
Ideas on how I can programmatically detect that a field contains commas and treat them all the same? An example is below:
08/06/2009,12:04:41 PM,PRINT,OBSCURRED,OBSCURRED,,Microsoft Word - Verizonlist809.doc,4,0,4,,1,,Lexmark X646e,791M8F4,LETTER,LETTER,TRUE,OBSCURRED,OBSCURRED,OBSCURRED,Lexmark X646e,
08/06/2009,12:38:04 PM,PRINT,OBSCURRED,OBSCURRED,,Microsoft Word - Roster 2009, 07.doc,15,0,15,,1,,Lexmark X646e,791M8F4,LETTER,LETTER,FALSE,OBSCURRED,OBSCURRED,OBSCURRED,Lexmark X646e,