awk取文字中兩個字串之間的部分

kisslfcr發表於2018-05-10
[oracle@irac01 scripts]$ cat cutt.txt
ablgnfrkjdlgbj;fagh10000afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh10030afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh10020afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh100400afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh103000afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh100900afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh10000afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh10087300afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh7753afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh100700afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh100400afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh10044500afrghnlfnhkjneah
ablgnfrkjdlgbj;fagh10040afrghnlfnhkjneah


[oracle@irac01 scripts]$ awk -F '' '{print $2}' cutt.txt|awk -F '</tradeCode>' '{print $1}' 
10000
10030
10020
100400
103000
100900
10000
10087300
7753
100700
100400
10044500
10040

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29135257/viewspace-2154259/,如需轉載,請註明出處,否則將追究法律責任。

相關文章