5

I have a large csv file that I need to convert to json, and then store the data into neo4j. I am using the csv-parser plugin for node.js. This works fine if the csv is valid. However if it's not valid, then the data in neo4j gets scrambled. Therefore I need to validate the file, before I can send it into my database. Are there any existing plugins available or is there a way for me to validate the csv file myself?

0

1 Answer 1

5

You might look into checking out the API for csvlint

I also suggest checking out this similar answer. (Below this answer also has good csvlint info, too)

There is also fast-csv which has some validation built in, which may help depending on your needs.

Otherwise, finding a validator that caters to your specific needs may be difficult, and I suggest writing editing your node script to validate it for yourself.


Update: I would also like to recommend Papa Parse, which has several parsing options.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, I have already looked at csvlint and the other thread you mention. I thought there may be other available solutions. Thanks for the reply anyways.
edited in another solution, may or may not be of use. It might help if you posted some examples of exactly what you need, since there may not be a one size fits all solution. Good luck!

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.