类 CSVReader
java.lang.Object
com.sh.common.csv.CSVReader
- 所有已实现的接口:
Closeable,AutoCloseable
Description: 读取CSV文件
Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
-
字段概要
字段 -
构造器概要
构造器构造器说明CSVReader(InputStream is) Constructs CSVReader using a comma for the separator.Constructs CSVReader with supplied separator.Constructs CSVReader with supplied separator and quote char.Constructs CSVReader with supplied separator, quote char and quote handling behavior.Constructs CSVReader with supplied separator and quote char.Constructs CSVReader with supplied separator and quote char.CSVReader(Reader reader, char separator, char quotechar, char escape, int line, boolean strictQuotes) Constructs CSVReader with supplied separator and quote char.CSVReader(Reader reader, char separator, char quotechar, char escape, int line, boolean strictQuotes, boolean ignoreLeadingWhiteSpace) Constructs CSVReader with supplied separator and quote char.Constructs CSVReader with supplied separator and quote char. -
方法概要
-
字段详细资料
-
DEFAULT_SKIP_LINES
public static final int DEFAULT_SKIP_LINES- 另请参阅:
-
-
构造器详细资料
-
CSVReader
Constructs CSVReader using a comma for the separator.- 参数:
reader- the reader to an underlying CSV source.
-
CSVReader
-
CSVReader
-
CSVReader
Constructs CSVReader with supplied separator.- 参数:
reader- the reader to an underlying CSV source.separator- the delimiter to use for separating entries.
-
CSVReader
Constructs CSVReader with supplied separator and quote char.- 参数:
reader- the reader to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elements
-
CSVReader
Constructs CSVReader with supplied separator, quote char and quote handling behavior.- 参数:
reader- the reader to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsstrictQuotes- sets if characters outside the quotes are ignored
-
CSVReader
Constructs CSVReader with supplied separator and quote char.- 参数:
reader- the reader to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsescape- the character to use for escaping a separator or quote
-
CSVReader
Constructs CSVReader with supplied separator and quote char.- 参数:
reader- the reader to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsline- the line number to skip for start reading
-
CSVReader
Constructs CSVReader with supplied separator and quote char.- 参数:
reader- the reader to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsescape- the character to use for escaping a separator or quoteline- the line number to skip for start reading
-
CSVReader
public CSVReader(Reader reader, char separator, char quotechar, char escape, int line, boolean strictQuotes) Constructs CSVReader with supplied separator and quote char.- 参数:
reader- the reader to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsescape- the character to use for escaping a separator or quoteline- the line number to skip for start readingstrictQuotes- sets if characters outside the quotes are ignored
-
CSVReader
public CSVReader(Reader reader, char separator, char quotechar, char escape, int line, boolean strictQuotes, boolean ignoreLeadingWhiteSpace) Constructs CSVReader with supplied separator and quote char.- 参数:
reader- the reader to an underlying CSV source.separator- the delimiter to use for separating entriesquotechar- the character to use for quoted elementsescape- the character to use for escaping a separator or quoteline- the line number to skip for start readingstrictQuotes- sets if characters outside the quotes are ignoredignoreLeadingWhiteSpace- it true, parser should ignore white space before a quote in a field
-
-
方法详细资料
-
readAll
Reads the entire file into a List with each element being a String[] of tokens- 返回:
- a List of String[], with each String[] representing a line of the file
- 抛出:
IOException- IOException
-
readNext
Reads the next line from the buffer and converts to a string array.- 返回:
- a string array with each comma-separated element as a separate entry.
- 抛出:
IOException- IOException
-
close
Closes the underlying reader.- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 抛出:
IOException- IOException
-
hasNext
public boolean hasNext()
-