CSV helper methods for parsing and stringifying CSV data Provides utilities for working with CSV files and data in pricing scripts

Hierarchy

  • CsvHelper

Methods

Methods

  • Parse CSV string into array of arrays Converts CSV text data into a structured format for processing in pricing scripts

    Parameters

    • csv: string

      CSV string to parse

    • Optional options: CsvOptions

      Parsing options to configure delimiter, quote character, etc.

    • Optional disableNumberConversion: boolean

      Whether to disable automatic number conversion

    Returns any[][]

    Array of arrays representing the CSV data, where each inner array is a row

    Example

    var csvData = HelperMethods.CSV.parse("1,Product A,10.99\n2,Product B,15.50");
    // Result: [["1", "Product A", "10.99"], ["2", "Product B", "15.50"]]
  • Convert array of arrays to CSV string Converts structured data back to CSV format for output or file generation

    Parameters

    • table: any[][]

      Array of arrays to convert, where each inner array is a row

    • Optional options: CsvStringifyOptions

      Stringify options to configure output format

    Returns string

    CSV string representation of the data

    Example

    var data = [["1", "Product A", "10.99"], ["2", "Product B", "15.50"]];
    var csvString = HelperMethods.CSV.stringify(data);
    // Result: "1,Product A,10.99\n2,Product B,15.50"

Generated using TypeDoc