Skip to main content
Question

CSV Update values in AA

  • 30 July 2024
  • 2 replies
  • 26 views

Hi ,

 

Im trying to update a csv file based on the column header values. Need your inputs on this to update the accurate data.

As of now im just updating by referring to next empty cell based on column index assumption. But in few cases its causing error.

Hi @Kayal 2500 I don’t think you can update a existing csv file. You can append data into a csv file but can’t overwrite a field value in a existing csv. 

You can get the data from csv to data table and perform the updates and then use write from data table to a new csv file. 
 


I agree with @RV27. Get your csv data into an AA data table and update the data as needed by looping through etc. Then you can write the data back out to a csv when complete (if you need to).

Since you are referring to the ‘next empty cell’ I’m thinking you are opening the csv file in excel and using excel actions to update. That’s not the best method to update csv files as excel has its own ‘csv format’ and when you save after updating it it may not be in the format you expect if you have to use that csv downstream in your automation.

If you give more details on what you are trying to accomplish with updating the csv, we can guide you through how to use a data table in AA.


Reply