Documentation ¶
Index ¶
- Variables
- func GetFileList(dir string) ([]string, error)
- func IsDir(dir string) bool
- func IsExists(name string) (bool, error)
- func SplitFileByLines(inputFile string, linesPerFile int, addHeader, deleteSource bool) error
- func SplitFileBySize(inputFile string, chunkSizeMB int, addHeader, deleteSource bool) error
- type ParseError
- type Reader
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBareQuote = errors.New("bare \" in non-quoted-field") ErrQuote = errors.New("extraneous or missing \" in quoted-field") ErrFieldCount = errors.New("wrong number of fields") // Deprecated: ErrTrailingComma is no longer used. ErrTrailingComma = errors.New("extra delimiter at end of line") )
These are the errors that can be returned in [ParseError.Err].
Functions ¶
func SplitFileByLines ¶
SplitFileByLines 按文件行数拆分文件 参数:
- inputFile - 文件路径
- linesPerFile - 每个文件的行数
- addHeader - 是否添加文件头
- deleteSource - 是否删除源文件
返回:
- 错误信息
Types ¶
type ParseError ¶
type ParseError struct { StartLine int // Line where the record starts Line int // Line where the error occurred Column int // Column (1-based byte index) where the error occurred Err error // The actual error }
A ParseError is returned for parsing errors. Line and column numbers are 1-indexed.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
func (*ParseError) Unwrap ¶
func (e *ParseError) Unwrap() error
type Reader ¶
type Reader struct { Escape byte Comma string Comment rune FieldsPerRecord int LazyQuotes bool TrimLeadingSpace bool ReuseRecord bool TrailingComma bool // contains filtered or unexported fields }
func (*Reader) InputOffset ¶
Click to show internal directories.
Click to hide internal directories.