-3

Here's a sample of my csv file

5,DENTISTRY,MAJOR,null,TRUE
6,DERMATOLOGY,MAJOR,null,TRUE
7,"EYE, EAR, NOSE, THROAT",MAJOR,null,TRUE
8,EMERGENCY MEDICINE,MAJOR,null,TRUE

How do I split this csv file while ignoring the comma inside double quotes?

user962206
  • 15,637
  • 61
  • 177
  • 270

1 Answers1

1

You should use a proper CSV parsing library, rather than trying to simply split the lines.

Parsing CSV well is harder than it initially seems, and you're much better off using a high quality, working library.

You can find recommendations about CSV libraries here:
CSV API for Java

Community
  • 1
  • 1
Tim
  • 6,406
  • 22
  • 34