In one of my projects I had to deal with Comma Separated files (CSV). I had to split data based on Comma , ignoring commas inside quotes (i.e. \"\") so
,
\"\"
You need to use the split(java.lang.String, int) method
Your code would then look like:
String str = "20Y-62-27412,20Y6227412NK,BRACKET,101H,00D505060,H664374,06/25/2013,1,,"; String[] rowData = str.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)", -1);