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
Overrides
Source
packages/core/src/readers/CSVReader.ts:23
Properties
colJoiner
private
colJoiner:string
Source
packages/core/src/readers/CSVReader.ts:13
concatRows
private
concatRows:boolean
Source
packages/core/src/readers/CSVReader.ts:12
papaConfig?
private
optional
papaConfig:ParseConfig
<any
,undefined
>
Source
packages/core/src/readers/CSVReader.ts:15
rowJoiner
private
rowJoiner:string
Source
packages/core/src/readers/CSVReader.ts:14
Methods
loadData()
Parameters
• filePath: string
Returns
Promise
<Document
<Metadata
>[]>
Inherited from
Source
packages/core/src/readers/type.ts:17
loadDataAsContent()
loadDataAsContent(
fileContent
):Promise
<Document
<Metadata
>[]>
Loads data from csv files
Parameters
• fileContent: Buffer
Returns
Promise
<Document
<Metadata
>[]>
Overrides
FileReader
. loadDataAsContent
Source
packages/core/src/readers/CSVReader.ts:42
addMetaData()
static
addMetaData(filePath
): (doc
,index
) =>void
Parameters
• filePath: string
Returns
Function