From acafc7464a8e7b792e8fbf2d685587098e3d5e18 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 31 Jul 2016 20:05:56 -0400 Subject: [PATCH] that ain't supposed to be in there --- core/src/processing/data/Table.java | 87 ----------------------------- 1 file changed, 87 deletions(-) diff --git a/core/src/processing/data/Table.java b/core/src/processing/data/Table.java index d22fa931e..5d86e45bb 100644 --- a/core/src/processing/data/Table.java +++ b/core/src/processing/data/Table.java @@ -739,93 +739,6 @@ public class Table { } return csl.handle(line, reader); } - /* - static protected String[] splitLineCSV(String line, BufferedReader reader) throws IOException { - char[] c = line.toCharArray(); - - // get tally of number of columns and allocate the array - int cols = 1; // the first comma indicates the second column - boolean quote = false; - for (int i = 0; i < c.length; i++) { - if (!quote && (c[i] == ',')) { - cols++; - } else if (c[i] == '\"') { - // double double quotes (escaped quotes like "") will simply toggle - // this back and forth, so it should remain accurate - quote = !quote; - } - } - String[] pieces = new String[cols]; - - // now do actual parsing - int pieceCount = 0; - int offset = 0; - while (offset < c.length) { - int start = offset; - int stop = nextComma(c, offset); - while (stop == -1) { - // found a newline inside the quote, grab another line - String nextLine = reader.readLine(); - System.out.println("extending to " + nextLine); - if (nextLine == null) { - System.err.println(line); - throw new IOException("Found a quoted line that wasn't terminated properly."); - } - char[] temp = new char[c.length + 1 + nextLine.length()]; - PApplet.arrayCopy(c, temp, c.length); - // NOTE: we're converting to \n here, which isn't perfect - temp[c.length] = '\n'; - line.getChars(0, nextLine.length(), temp, c.length + 1); - c = temp; - stop = nextComma(c, offset); - System.out.println("stop is now " + stop); - } - offset = stop + 1; // next time around, need to step over the comment - if (c[start] == '\"' && c[stop-1] == '\"') { - start++; - stop--; - } - int i = start; - int ii = start; - while (i < stop) { - if (c[i] == '\"') { - i++; // skip over pairs of double quotes become one - } - if (i != ii) { - c[ii] = c[i]; - } - i++; - ii++; - } - /* - if (autoTyping) { - if (autoTypes == null) { - autoTypes = new int[pieces.length]; - - } else { - if (autoTypes.length < pieces.length) { - - } - Double.parseDouble(""); - Float.parseFloat("blah"); -// if (autoTypes[pieceCount]) { -// -// } - } - } - */ - String s = new String(c, start, ii - start); - pieces[pieceCount++] = s; - } - // Make any remaining entries blanks instead of nulls. Empty columns from - // CSV are always "" not null, so this handles successive commas in a line - for (int i = pieceCount; i < pieces.length; i++) { - pieces[i] = ""; - - } - return pieces; - } - */ /**