Package | Description |
---|---|
cn.hutool.core.text.csv |
提供CSV文件读写的封装,入口为CsvUtil
规范见:https://datatracker.ietf.org/doc/html/rfc4180 |
Modifier and Type | Method and Description |
---|---|
static CsvWriteConfig |
CsvWriteConfig.defaultConfig()
默认配置
|
CsvWriteConfig |
CsvWriteConfig.setAlwaysDelimitText(boolean alwaysDelimitText)
设置是否始终使用文本分隔符,文本包装符,默认false,按需添加
|
CsvWriteConfig |
CsvWriteConfig.setEndingLineBreak(boolean endingLineBreak)
文件末尾是否添加换行符
按照https://datatracker.ietf.org/doc/html/rfc4180#section-2 规范,末尾换行符可有可无。 |
CsvWriteConfig |
CsvWriteConfig.setLineDelimiter(char[] lineDelimiter)
设置换行符
|
Modifier and Type | Method and Description |
---|---|
static CsvWriter |
CsvUtil.getWriter(File file,
Charset charset,
boolean isAppend,
CsvWriteConfig config)
获取CSV生成器(写出器)
|
static CsvWriter |
CsvUtil.getWriter(Writer writer,
CsvWriteConfig config)
获取CSV生成器(写出器)
|
Constructor and Description |
---|
CsvWriter(File file,
Charset charset,
boolean isAppend,
CsvWriteConfig config)
构造
|
CsvWriter(String filePath,
Charset charset,
boolean isAppend,
CsvWriteConfig config)
构造
|
CsvWriter(Writer writer,
CsvWriteConfig config)
构造
|
Copyright © 2024. All rights reserved.