Class ExcelCSVParser
2016-05-18 11:17
381 查看
原文地址: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.
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. |
相关文章推荐
- mysql load data 导出、导入 csv
- C#导出数据到CSV文件的通用类实例
- C#实现导入CSV文件到Excel工作簿的方法
- php操作csv文件代码实例汇总
- php读取csv文件并输出的方法
- C#操作CSV文件类实例
- php使用指定编码导出mysql数据到csv文件的方法
- C#中csv文件与DataTable互相导入处理实例解析
- javascript实现客户端兼容各浏览器创建csv并下载的方法
- 解析csv数据导入mysql的方法
- php导出csv数据在浏览器中输出提供下载或保存到文件的示例
- 如何在symfony中导出为CSV文件中的数据
- Python使用cx_Oracle模块将oracle中数据导出到csv文件的方法
- MySQL 导出数据为csv格式的方法
- mysql使用SQLyog导入csv数据不成功的解决方法
- MySQL如何导入csv格式数据文件解决方案
- php将文本文件转换csv输出的方法
- php实现CSV文件导入和导出
- thinkPHP导出csv文件及用表格输出excel的方法
- php读取csv数据保存到数组的方法