Package | Description |
---|---|
cn.hutool.core.text.csv |
提供CSV文件读写的封装,入口为CsvUtil
规范见:https://datatracker.ietf.org/doc/html/rfc4180 |
Modifier and Type | Method and Description |
---|---|
static CsvWriter |
CsvUtil.getWriter(File file,
Charset charset)
获取CSV生成器(写出器),使用默认配置,覆盖已有文件(如果存在)
|
static CsvWriter |
CsvUtil.getWriter(File file,
Charset charset,
boolean isAppend)
获取CSV生成器(写出器),使用默认配置
|
static CsvWriter |
CsvUtil.getWriter(File file,
Charset charset,
boolean isAppend,
CsvWriteConfig config)
获取CSV生成器(写出器)
|
static CsvWriter |
CsvUtil.getWriter(String filePath,
Charset charset)
获取CSV生成器(写出器),使用默认配置,覆盖已有文件(如果存在)
|
static CsvWriter |
CsvUtil.getWriter(String filePath,
Charset charset,
boolean isAppend)
获取CSV生成器(写出器),使用默认配置
|
static CsvWriter |
CsvUtil.getWriter(Writer writer)
获取CSV生成器(写出器)
|
static CsvWriter |
CsvUtil.getWriter(Writer writer,
CsvWriteConfig config)
获取CSV生成器(写出器)
|
CsvWriter |
CsvWriter.setAlwaysDelimitText(boolean alwaysDelimitText)
设置是否始终使用文本分隔符,文本包装符,默认false,按需添加
|
CsvWriter |
CsvWriter.setLineDelimiter(char[] lineDelimiter)
设置换行符
|
CsvWriter |
CsvWriter.write(CsvData csvData)
将一个 CsvData 集合写出到Writer
|
CsvWriter |
CsvWriter.write(Iterable<?> lines)
将多行写出到Writer
|
CsvWriter |
CsvWriter.write(String[]... lines)
将多行写出到Writer
|
CsvWriter |
CsvWriter.writeBeans(Iterable<?> beans)
将一个Bean集合写出到Writer,并自动生成表头
|
CsvWriter |
CsvWriter.writeBeans(Iterable<?> beans,
boolean writeHeaderLine,
String... properties)
将一个Bean集合写出到Writer,并自动生成表头
|
CsvWriter |
CsvWriter.writeBeans(Iterable<?> beans,
String... properties)
将一个Bean集合写出到Writer,并自动生成表头
|
CsvWriter |
CsvWriter.writeComment(String comment)
写出一行注释,注释符号可自定义
如果注释符不存在,则抛出异常 |
CsvWriter |
CsvWriter.writeHeaderLine(String... fields)
写出一行头部行,支持标题别名
|
CsvWriter |
CsvWriter.writeLine()
追加新行(换行)
|
CsvWriter |
CsvWriter.writeLine(String... fields)
写出一行
|
Copyright © 2024. All rights reserved.