Merging columns from multiple files in one file

Hi,

I want to select columns from multiple files and combine them in one file. The files are simulation-data-files with 23 columns each and about 50 rows. I now use:

cut -f 11 Sweep?wing-30?scale=0.?0?fan2?.txt | pr -3 | awk '{printf("\n%s\t%s\t%s",$1,$2,$3)}' > ../Data_Processed/output.txt

I cut the 11th column out of files called
Sweep|wing-30|scale=0.30|fan2|.txt
Sweep|wing-30|scale=0.50|fan2|.txt
Sweep|wing-30|scale=0.70|fan2|.txt,
put them in 3 columns with pr -3 (instead of having all the columns joined underneath each other) and than use awk again to make the formatting tab-delimited.

It seems to me that there might be an easier solution to merge these files. One that only uses awk and getline maybe? And automatically format and for variable number of input files?

regards.

That solution seems fine to me as it is, however you could do something like:

awk '{ printf $11 OFS } !FNR%3 { print "" }' Sweep?wing-30?scale=0.?0?fan2?.txt'