spreadsheetReadCsv

Creates a new spreadsheet workbook from a CSV file. The file is parsed into a single sheet (named Sheet1) with one row per line; quoted fields, escaped quotes and embedded delimiters/newlines are honoured. The fluent member form fromCsv(csvText, delimiter) instead replaces the active sheet's cells from an in-memory CSV string.

spreadsheetReadCsv(filePath [, delimiter]) → returns any

This function requires RustCFML.  Not supported on Lucee, Adobe ColdFusion, etc.

Argument Reference

filePath string
Required

Path to the CSV file to read.

delimiter string
Default: ,

Single-character field delimiter (default comma).

Compatibility

RustCFML:

Not supported on wasm32.

Examples
Sample code invoking the spreadsheetReadCsv function

Read the CSV to a workbook, then convert it to a query.

fileWrite(expandPath("/data.csv"), "name,score\nAlice,90\nBob,75");
wb = spreadsheetReadCsv(expandPath("/data.csv"));
writeDump(spreadsheetToQuery(wb));

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub