Java CSV parser with string separator (multi-character) - Stack Overflow
Disadvantage of this approach is that you lose the ability to ignore quote characters or escape separators..
Update
Instead of pre-processing the data, altering it's content, why not combine both of the above approaches in a two step process:
- Use the "roll your own" to first validate the data. Split each line and prove that it contains the requiste number of fields.
- Use the "field ignoring" approach to parse the validated data, secure in the knowledge that the correct number of fields have been specified.
Not very efficient, but possibly easier that writing your own CSV parser :-)
Read full article from Java CSV parser with string separator (multi-character) - Stack Overflow
No comments:
Post a Comment