:- use_module(library(csv)).(can be autoloaded)
Suppose we want to create a predicate table/6
from a CSV file that we know contains 6 fields per record. This can be
done using the code below. Without the option
this would generate a predicate table/N, where N is the number of fields
per record in the data.
?- csv_read_file(File, Rows, [functor(table), arity(6)]), maplist(assert, Rows).