Say, you have two files file1 and file2 containing data in the tabular form in 3 columns each and you want to extract column 2 of file1 and column 1 of file2. We can do it using the combination of paste and awk commands as follows:
paste file1 file2 | awk '{print $2 " " $4}'
We can do more! Suppose you want to add column 1 of file1 to column 3 of file2. This can be accomplished using the following command:
paste file1 file2 | awk '{print $1-$6}'






1 comments:
Nice Article.
Some examples on Find Command and Awk Command
Post a Comment