Skip to content
Advertisement

Add data to specific record in CSV file

I have a record in a CSV file and i am trying to add some extra info (a name) to the same specific record with the following code but it does not work. There is no error shown but the info i am trying to add just does not appear. What am i missing ?

JavaScript

Advertisement

Answer

Here the requirement is to add an extra column if the animal name matches. It’s equivalent to changing a particular line in a file. Here’s a simple approach to achieve the same, (Without using any extra libraries),

JavaScript
Advertisement