Nhảy tới nội dung

Class: PapaCSVReader

papaparse-based csv parser

Implements

BaseReader

Implements

Constructors

constructor

new PapaCSVReader(concatRows?, colJoiner?, rowJoiner?, papaConfig?)

Constructs a new instance of the class.

Parameters

NameTypeDefault valueDescription
concatRows?booleantruewhether to concatenate all rows into one document.If set to False, a Document will be created for each row.True by default.
colJoiner?string", "-
rowJoiner?string"\n"Separator to use for joining each row.Only used when concat_rows=True.Set to "\n" by default.
papaConfig?ParseConfig<any, undefined>undefined-

Defined in

packages/core/src/readers/CSVReader.ts:23

Properties

colJoiner

Private colJoiner: string

Defined in

packages/core/src/readers/CSVReader.ts:13


concatRows

Private concatRows: boolean

Defined in

packages/core/src/readers/CSVReader.ts:12


papaConfig

Private Optional papaConfig: ParseConfig<any, undefined>

Defined in

packages/core/src/readers/CSVReader.ts:15


rowJoiner

Private rowJoiner: string

Defined in

packages/core/src/readers/CSVReader.ts:14

Methods

loadData

loadData(file, fs?): Promise<Document<Metadata>[]>

Loads data from csv files

Parameters

NameTypeDefault valueDescription
filestringundefinedThe path to the file to load.
fs?GenericFileSystemDEFAULT_FSThe file system to use for reading the file.

Returns

Promise<Document<Metadata>[]>

Implementation of

BaseReader.loadData

Defined in

packages/core/src/readers/CSVReader.ts:41