Carey Brown wrote:There are java libraries which will parse csv, I've not used one myself, but they may be able to handle this situation.
Carey Brown wrote:You could write java that would do it but it would also be brittle in that a change to your data would probably change how certain lines are split. I don't know if it is possible but a better tactic would be to tackle the split where it is occurring. What program are you using to generate the csv and what program are you using to display the csv?
Carey Brown wrote:There are java libraries which will parse csv, I've not used one myself, but they may be able to handle this situation.
Carey Brown wrote:If java is creating the csv can you modify it to not replace the comma with a new line?
Paul Clapham wrote:The code is easy enough to write. Read the file one character at a time and use a flag to tell whether you're inside a quote. Then for each character: if it's not quote or end-line, write it to the output. If it's end-line, write end-line or space depending on whether you're inside a quote. If it's quote, write it and flip the flag.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Paul Clapham wrote:The code is easy enough to write. Read the file one character at a time and use a flag to tell whether you're inside a quote. Then for each character: if it's not quote or end-line, write it to the output. If it's end-line, write end-line or space depending on whether you're inside a quote. If it's quote, write it and flip the flag.
Phillip Powell wrote:It's not a course but a company requirement
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |