how to append columns form a column file in another file
hello all
i want to know how to write abash script that append columns form a column file in another file ia have tried many things but it failed cut -f 1 -d " " test1 >> hello.txt & cut -f 2 -d " " >> hello.txt awk '{print $1}' test1 > hello.txt | cut -f 2 -d " " >> hello.txt awk '{print $1}' test1 > hello.txt && cut -f 2 -d " " >> hello.txt can any one give me a help and any help will be appreciated |
Maybe something like this...
Code:
cut -d" " -f1,2 file.txt > file1.txt |
tahnks for you help but what i mean i want to append 2 columns from 2 different files to another file :
the contents of the first file : adams smith sara wittel the contents of the second file : age 22 age 33 after appending will make new file has the contents adams 22 sara 33 |
sorry, misunderstood that part.
Maybe paste will do... Code:
paste -d" " file1.txt file2.txt | cut -d" " -f1,4 > file3.txt |
thanks very much :)
|
All times are GMT -5. The time now is 05:58 AM. |