Static
createimport { CsvUtils } from '@tableau/taco-toolkit/handlers'
const rows: string[][] = [
["User1", "user1@example.com", "(555)555-5555"],
["User2", "user2@example.com", "(123)456-7890"],
]
const columnNames: string[] = ["Name", "Email", "Phone Number"]
const result = await CsvUtils.createDataRows(rows, columnNames)
// result: an array of DataRow
Static
parseA utility method to parse CSV data into a two-dimensional array. Input data could be ArrayBuffer or string.
This function returns a Promise that resolves to an object with headers and rows properties.
import { CsvUtils } from '@tableau/taco-toolkit/handlers'
const rawData: string =
"Name,Email,Phone Number\n" +
"User1,user1@example.com,(555)555-5555\n" +
"User2,user2@example.com,(123)456-7890"
const { headers, rows } = await CsvUtils.parse(rawData, { hasHeader: true})
// result: an object with headers and rows properties
Generated using TypeDoc
A utility method to convert a two-dimensional array of data into an array of DataRow.
This function returns a Promise that resolves to an array of DataRow.