ITPub博客

首页 > Linux操作系统 > Linux操作系统 > awk取文本中两个字符串之间的部分

awk取文本中两个字符串之间的部分

原创 Linux操作系统 作者:kisslfcr 时间:2018-05-10 09:53:11 0 删除 编辑
[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/,如需转载,请注明出处,否则将追究法律责任。

下一篇: grep的或操作
请登录后发表评论 登录
全部评论

注册时间:2015-01-12

  • 博文量
    245
  • 访问量
    352376