Bitbybit Docs
    Preparing search index...

    Class ParseToJsonWithHeadersDto (Inputs.CSV)

    Feeds csv.parseToJsonWithHeaders: the CSV text, the header names to use instead of a header line, where the data starts, the separators and which columns to read as numbers.

    Index

    Constructors

    • Parameters

      • Optionalcsv: string
      • Optionalheaders: string[]
      • OptionaldataStartRow: number
      • OptionalrowSeparator: string
      • OptionalcolumnSeparator: string
      • OptionalnumberColumns: string[]

      Returns ParseToJsonWithHeadersDto

    Properties

    csv: string

    The whole CSV text, normally without a header line

    John,30\nJane,25
    
    headers: string[]

    The object keys, one per column in column order; a row with more cells than keys loses the extra cells

    ["name", "age"]
    
    dataStartRow?: number

    Index of the first row turned into an object, counting from 0; set it to 1 to skip a header line the text does have

    0
    

    0

    Infinity

    1

    rowSeparator?: string

    The text between rows, normally a line break; \n written as two characters is read as one

    \n
    
    columnSeparator?: string

    The text between cells in a row, normally a comma; \t written as two characters is read as a tab

    ,
    
    numberColumns?: string[]

    Header names whose cells are parsed as numbers; every other cell stays text

    undefined
    

    true