• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
    • RDF quality heuristics
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

A.11 library(csv): Process CSV (Comma-Separated Values) data
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(csv): Process CSV (Comma-Separated Values) data
          • csv_read_file/2
          • csv_read_file/3
          • csv_read_stream/3
          • csv//1
          • csv//2
          • csv_read_file_row/3
          • csv_read_row/3
          • csv_options/2
          • csv_write_file/2
          • csv_write_file/3
          • csv_write_stream/3
    • Packages
Availability::- use_module(library(csv)).(can be autoloaded)
Source[nondet]csv_read_file_row(+File, -Row, +Options)
True when Row is a row in File. First unifies Row with the first row in File. Backtracking yields the second, ... row. This interface is an alternative to csv_read_file/3 that avoids loading all rows in memory. Note that this interface does not guarantee that all rows in File have the same arity.

In addition to the options of csv_read_file/3, this predicate processes the option:

line(-Line)
Line is unified with the 1-based line-number from which Row is read. Note that Line is not the physical line, but rather the logical record number.
To be done
Input is read line by line. If a record separator is embedded in a quoted field, parsing the record fails and another line is added to the input. This does not nicely deal with other reasons why parsing the row may fail.
ClioPatria (version V3.1.1-40-g9d9e003)