Use this file to discover all available pages before exploring further.
Compatibility: Only available on Node.js.
This notebook provides a quick overview for getting started with CSVLoaderdocument loaders. For detailed documentation of all CSVLoader features and configurations head to the API reference.This example goes over how to load data from CSV files. The second argument is the column name to extract from the CSV file. One document will be created for each row in the CSV file. When column is not specified, each row is converted into a key/value pair with each key/value pair outputted to a new line in the document’s pageContent. When column is specified, one document is created for each row, and the value of the specified column is used as the document’s pageContent.
id|html1|"<i>Corruption discovered at the core of the Banking Clan!</i>"2|"<i>Reunited, Rush Clovis and Senator Amidala</i>"3|"<i>discover the full extent of the deception.</i>"4|"<i>Anakin Skywalker is sent to the rescue!</i>"
import { CSVLoader } from "@langchain/community/document_loaders/fs/csv";const singleColumnLoader = new CSVLoader( exampleCsvPath, { column: "html", separator:"|" });const singleColumnDocs = await singleColumnLoader.load();console.log(singleColumnDocs[0]);
Document { pageContent: '<i>Corruption discovered at the core of the Banking Clan!</i>', metadata: { source: '../../../../../../langchain/src/document_loaders/tests/example_data/example_separator.csv', line: 1 }, id: undefined}