Bluestep JS Documentation
    Preparing search index...

    Class CSV

    See [[B.csv]]

    Index

    Constructors

    Methods

    • A single character that represents the escape character for this parser

      Parameters

      • escapeChar: string

      Returns CSV

    • A single character that represents a field delimeter for this parser

      Parameters

      • fieldDelimiterCharacter: string

      Returns CSV

    • Provides each row for processing. This is the preferred way of processing a whole file. This is equivelent to:

      	while(csv.next) {
      callback(csv.row);
      }

      Parameters

      • rowConsumer: (row: EList<string>, index?: number, csv?: CSV) => void

      Returns void

    • Returns true if there are more rows. Prepares [[row]] to contain data for the next row.

      Returns boolean

    • Returns the row in the file as an array of strings. Used in a while loop with [[next]]

      Returns EList<string>


      while(csv.next) {
      csv.row.forEach(function (col) {
      //process the column.
      });
      };
    • A single character that represents a text delimeter for this parser

      Parameters

      • textDelimeterCharacter: string

      Returns CSV

    • Copy the input to a two dimensional array

      Returns EList<EList<string>>


      csv.toList().forEach(function (row) {
      row.forEach(function (col) {
      //process the column.
      });
      });
    • Copy the input to an array of objects where the keys of the object come from the first row.

      Returns EList<{ [key: string]: string }>


      csv.toListOfObjects().forEach(function (row) {
      let firstName = row.First;
      let lastName = row.Last;
      let birthday = row.Birthday;
      });