Option from_line

The from_line option handles records starting from a requested line number. The counting of lines start at 1 which is the default value, thus the first line is 1.

  • Type: number
  • Coercion: string to number
  • Optional
  • Default: 1
  • Since: 4.0.0
  • Related: to_line, from, to — see Available Options

Simple example with inferred column names

This example skip the first lines and return records after the second line. The first records is used to determine column names:

const parse = require('csv-parse')
const assert = require('assert')

parse(`
x,x
a,b
1,2
`.trim(), {
  columns: true,
  from_line: 2
}, function(err, records){
  assert.deepEqual(
    records, [{
      a: '1',
      b: '2'
    }]
  )
})