Shell script, an awk array of how to handle multiple files.

Source: Internet
Author: User

[[Email protected]awk]#seq Ten|Xargs-N2>file[[Email protected]awk]#seq Ten-1 1|Xargs-N2>File1[[email protected]awk]#Cat file1 23 45 67 89 Ten[[Email protected]awk]#Catfile1Ten 98 76 54 32 1[[Email protected]awk]#Cat file|awk '{print $}'13579[[Email protected]awk]#Catfile1 |awk '{print $}'97531[[Email protected]awk]#Cat file|awk '{print $}'>File3[[email protected]awk]#Catfile1 |awk '{print $}'>File4[[email protected]awk]# paste File3 file41    93    75    57    39    1[[Email protected]awk]# Paste File3 file4|TR "\ t" " "1 93 75 57 39 1[[Email protected]awk]# Paste File3 file4|TR "\ t" " ">File5[[email protected]awk]#CatFile51 93 75 57 39 1[[Email protected]awk]#awk '1' file1 23 45 67 89 Ten[[Email protected]awk]#awk '1'file1Ten 98 76 54 32 1[[Email protected]awk]#awk '1'file1 file1Ten 98 76 54 32 1Ten 98 76 54 32 1[[Email protected]awk]#awk '{print NR}' filefile1123456789Ten[[Email protected]awk]#awk '{print NR,FNR}' filefile11 12 23 34 45 56 17 28 39 4Ten 5[[Email protected]awk]# [[email protected]awk]#awk 'Nr==fnr{a[nr]=$1}nr!=fnr{print a[fnr],$2}' filefile11 93 75 57 39 1[[Email protected]awk]#

Shell script, an awk array of how to handle multiple files.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.