i have the following csv file:
"Maria,"Emilia",Brown",Martinez,5,40
I want the following outcome:
- "Maria,"Emilia",Brown"
- Martinez
- 5
- 40
I use the following matcher:
Matcher m = Pattern.compile("\"([^\"]+?)\"|(?<=,|^)([^,]*)(?=,|$)").matcher(line);
But instead i get the following result:
- "Maria,"
- ",Brown"
- Martinez
- 5
How the hell can i fix it. I tried everything, but i can't seem to find a good pattern.