I need to update a text file within a loop so that the value is added creating a new column at the end. I cannot use paste because I dont know the number of files. If I use >> the value is added after the last row. Please help.
For example:
Input file:
Column 1 Column2
- -
- -
- -
1st iteration,
Column 1 Column2 column3
- - (new values)
- -
- -
2nd iteration,
Column 1 Column2 column3 Column4
- - - (new values)
- - -
- - -
Or be more specific,
I have n files named F_1, F_2,....F_n each having one columns and same number of row. I have an in put file with one column and want to add columns of F_1 as 2nd column, F_2 as 3rd column ....
Input file:
Column 1
-
-
-
Output file:
Column1 Column2 Column3 . . . . .
(from F_1) (from F_2)
- - -
- - -
- - -