Class ExcelCSVParser

原文地址:http://ostermiller.org/utils/javadoc/ExcelCSVParser.html

The CSV that Excel outputs differs the format read by com.Ostermiller.util.CSVParser:

  • Leading and trailing whitespace is significant. 前导和尾随空白是重要的。
  • A backslash is not a special character and is not used to escape anything. 反斜杠不是特殊字符,而不是用来转义任何东西。
  • Quotes inside quoted strings are escaped with a double quote rather than a backslash.引号里面引用字符串用双引号而不是一个反斜杠。
  • Excel may convert data before putting it in CSV format:
    • Tabs are converted to a single space.
    • New lines in the data are always represented as the UNIX new line. ("\n")
    • Numbers that are greater than 12 digits may be represented in truncated scientific notation form.
    This parser does not attempt to fix these Excel conversions, but users should be aware of them.


Constructor Summary
ExcelCSVParser(InputStream in)
          Create a parser to parse comma separated values from an InputStream.
ExcelCSVParser(InputStream in, char delimiter)
          Create a parser to parse delimited values from an InputStream.
ExcelCSVParser(Reader in)
          Create a parser to parse comma separated values from a Reader.
ExcelCSVParser(Reader in, char delimiter)
          Create a parser to parse delimited values from a Reader.
 
Method Summary
 void changeDelimiter(char newDelim)
          Change this parser so that it uses a new delimiter.
 void changeQuote(char newQuote)
          Change this parser so that it uses a new character for quoting.
 void close()
          Close any stream upon which this parser is based.
 String[][] getAllValues()
          Get all the values from the file.
 int getLastLineNumber()
          Get the number of the line from which the last value was retrieved.
 String[] getLine()
          Get all the values from a line.
 int lastLineNumber()
          Get the line number that the last token came from.
 String nextValue()
          get the next value.
static String[][] parse(Reader in)
          Parse the comma delimited data from a stream.
static String[][] parse(Reader in, char delimiter)
          Parse the delimited data from a stream.
static String[][] parse(String s)
          Parse the comma delimited data from a string.
static String[][] parse(String s, char delimiter)
          Parse the delimited data from a string.
 void setCommentStart(String commentDelims)
          Set the characters that indicate a comment at the beginning of the line.

你可能感兴趣的:(csv)