I have four text files each containing a single field. I want to convert them into a single text file with four fields (one from each file). How can I do this using shell scripting.
Asked
Active
Viewed 1,926 times
2 Answers
3
This should do:
paste file_1 file_2 file_3 file_4
If you want pretty printing (given that the number of lines are same for all the files), then:
paste 1 2 3 4 | column -t

heemayl
- 56,300
column
is likely to break things for files that don't have the same number of lines. – peterph Feb 03 '15 at 19:49column
accepts... see glenn jackman's answer here - it works fine with files that don't have the same number of lines. – don_crissti Feb 03 '15 at 21:11