Class: PapaCSVReader
papaparse-based csv parser CSVReader
Implements
BaseReader
Implements
Constructors
constructor
• new PapaCSVReader(concatRows?
, colJoiner?
, rowJoiner?
, papaConfig?
): PapaCSVReader
Constructs a new instance of the class.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
concatRows? | boolean | true | whether to concatenate all rows into one document.If set to False, a Document will be created for each row.True by default. |
colJoiner? | string | ", " | Separator to use for joining cols per row. Set to ", " by default. |
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 | - |
Returns
Defined in
packages/core/src/readers/CSVReader.ts:25
Properties
colJoiner
• Private
colJoiner: string
Defined in
packages/core/src/readers/CSVReader.ts:15
concatRows
• Private
concatRows: boolean
Defined in
packages/core/src/readers/CSVReader.ts:14
papaConfig
• Private
Optional
papaConfig: ParseConfig
<any
, undefined
>
Defined in
packages/core/src/readers/CSVReader.ts:17
rowJoiner
• Private
rowJoiner: string
Defined in
packages/core/src/readers/CSVReader.ts:16
Methods
loadData
▸ loadData(filePath
, fs?
): Promise
<Document
<Metadata
>[]>
Loads data from csv files
Parameters
Name | Type | Default value | Description |
---|---|---|---|
filePath | string | URL | undefined | The path to the file to load. |
fs? | GenericFileSystem | defaultFS | The file system to use for reading the file. |