0

I want to make a bulk insert from a CSV with columns names different to the ones in my database. I am developing a React Web application and would like to convert it to JSON with the correct columns names.

Here is an example:

Csv:

Prod,price,stock
Shirt,200,12

JSON:

{User_prod:'Shirt',User_price:'200',user_stock:'12'}
2

1 Answer 1

1

You can use the react csv libraries for loading and manipulating the csv header.

  1. https://www.npmjs.com/package/react-csv-reader
  2. https://www.npmjs.com/package/react-csv
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.