Skip to main content

Class: PapaCSVReader

papaparse-based csv parser CSVReader

Implements

BaseReader

Extends

Constructors

new PapaCSVReader()

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

Constructs a new instance of the class.

Parameters

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>

Returns

PapaCSVReader

Overrides

FileReader.constructor

Defined in

packages/llamaindex/src/readers/CSVReader.ts:22

Methods

loadData()

loadData(filePath): Promise<Document<Metadata>[]>

Parameters

filePath: string

Returns

Promise<Document<Metadata>[]>

Inherited from

FileReader.loadData

Defined in

packages/core/schema/dist/schema/index.d.ts:187


loadDataAsContent()

loadDataAsContent(fileContent): Promise<Document<Metadata>[]>

Loads data from csv files

Parameters

fileContent: Uint8Array

The content of the file.

Returns

Promise<Document<Metadata>[]>

An array of Documents.

Overrides

FileReader.loadDataAsContent

Defined in

packages/llamaindex/src/readers/CSVReader.ts:40


addMetaData()

static addMetaData(filePath): (doc, index) => void

Parameters

filePath: string

Returns

Function

Parameters

doc: Document<Metadata>

index: number

Returns

void

Inherited from

FileReader.addMetaData

Defined in

packages/core/schema/dist/schema/index.d.ts:188