How to access a particular row in a CSV file and update the value in the row?

aathira shaji :

I have a csv file with 2 rows - column headers and values.I need to access the value of each column and update the value.

this script is proving value in a new row.

CSVWriter writer=new CSVWriter(new FileWriter("C:\\Try.csv",true));     
writer.writeNext(pNumber);  
writer.close();
YouDontKnowAboutBear :

Simple Steps to do this:

  1. Create a new .csv file

  2. Read your file

  3. While reading your file, write to your new file and do the changes if necessary.

You can also check the similar question here: what is the best way to edit csv file

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=150501&siteId=1