code: public static int delimiterColumnCount(String row, String delimeterChar, String escapeChar) {
          if (row.indexOf(escapeChar) > 0)
              return row.replace(escapeChar, " ").length() - row.replace(",", "").length();
          else
              return row.length() - row.replace(",", "").length();
      }
docs: To count comma separated columns in a row to maintain compatibility