catamphetamine / read-excel-file

Read *.xlsx files in a browser or Node.js. Parse to JSON with a strict schema.

Home Page:https://catamphetamine.gitlab.io/read-excel-file/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to read the data from second row rather than first row

ramya-sc opened this issue · comments

Can you please suggest me how to read the data from second row?
Given example schema in the plugin reads from the first row , I just want to read the data from second row, please help me on this !!

In my Excel , 1st row says "Please enter your students information. " . I do not want to read this


image

Tried something like below::

` readXlsxFile(this.fileToUpload, {
schema,
transformData(data) {
console.log(data)
return ["ID","Student First Name","Student Last Name" , "Mobile Number","Email ID"].concat(data)
return data.filter(row => row.filter(column => column !== null).length > 0)
}

  }).then(({ rows, errors }) => {

console.log(rows) //getting an empty rows
}
`

Can you please suggest me where I went wrong?

See the README on transformData(rows).
There, one can remove the first row of a spreadsheet, for example.