If I understand what you're saying, you start out with a set of files with names along the lines of:
file01.txt
file02.txt
file03.txt
You then process each one of those text files in turn with awk
, which produces a column of data for each file processed. So in this hypothetical directory, there are now 6 files:
file01.txt
file02.txt
file03.txt
file01.txt.csv
file02.txt.csv
file03.txt.csv
And the last 3 files are the results of the awk
program.
To paste the CSV files produced in the previous step together into one CSV file with as many columns as there are files generated in the previous step, use:
paste -d '[DELIMITER]' file??.txt.csv > out.csv
Replace [DELIMITER]
in the above code with the character you want to use as the delimiter in the resulting CSV file. For example, if file01.txt.csv
contained the following data:
1
2
3
...and file02.txt.csv
contained the following data:
4
5
6
...and file03.txt.csv
contained the following data:
7
8
9
...then paste -d ';' file??.txt.csv > out.csv
would fill the file "out.csv" with:
1;4;7
2;5;8
3;6;9