Did you know ... Search Documentation:
Pack canny_tudor -- prolog/canny/csv.pl
PublicShow source

This module provides predicates for reading CSV files in a memory-efficient manner using Prolog engines. The main predicate, csv_read_file_by_row/3, allows for non-deterministic reading of CSV rows, yielding one row at a time.

author
- Roy Ratcliffe
 csv_read_file_by_row(+Spec, -Row:list, +Options) is nondet
Extracts records from a CSV file, using the given read Options. The resulting Row terms have fields named after the CSV header columns like an options list.

This predicate uses a Prolog engine to read the CSV file non-deterministically, yielding one Row term at a time. This is useful for processing large CSV files without loading the entire file into memory.

Arguments:
Spec- specifies the CSV file.
Row- is unified with each row.
Options- are passed to csv_read_file_row/3.