Is there a tool or using php to get it?

Update some columns content in some csv files with a batch.

eg: 1.csv 2.csv 3.csv 4.csv.....

All the columns name are the same in all the csv file.

Suppposed those csv files have columns test1 test2 test3 test4 test5...... . the test1 have contents like this:

0
0
0
0 
..

now, i want to change them to 99, namely:

99
99
99
99
..

Is there a tool or using php to update the content in all the csv files synchronously and update the content with a batch. thank you

Answers


Take a look at fgetcsv(), fputcsv(), and str_getcsv()


On windows there is no such tool to do that in batches automatically. You can however open all such files inside a spreadsheet application and quickly change them.

If the number of files is too much, you can pick the scripting language of your choice (PHP) and write some file processing routines that deal with the data and the change of it. The PHP manual leads you the way to multiple functions you can use, and so did NADH.

I hope this anwers your question.


Need Your Help

License expired after installation Microsoft Visual Studio 2015 community

visual-studio-2015

I've just installed Microsoft Visual Studio 2015 Community. After installation an signing in I'm getting error: