Hi Everyone:
My shell script creates multiple csv files (~30) in for loop. I want to compile (or merge) 3rd column from each (all) of these files to another file (in loop). Please help. Thanks.
Can you post your script?
You can extract the 3rd field in your for loop and create the new file
The shell script is big file can't post (someone else wrote it). But, it produces data01.csv, data02.csv, data03.csv, data04.csv, ..... data30.csv files.
Here is shell script I wrote (but not working) to get 3 column from these file to merge in another file.
for (( i = 1 ; i <= 30; i++ ))
do
cat data${i}.csv | while read record
do
echo $record | cut -d" " -f3 >> temp${i}.csv
done
paste temp${i}.csv > final_data.csv
done
Thank you.. It helped..