我想按顺序排列文件的多行。该文件的一个示例originalfile.txt可能是:
num=12
workers not specified
length= 128
Using array element
num= 24
workers not specified
length= 128
Using array element
......
我grep只想像所有带有numand的行一样有价值的行length:
num=12
length= 128
num= 24
length= 128
......
我知道如何只grep针对一种模式,比如说,num但我不知道如何针对多种模式进行操作。
$ grep "num" originalfile.txt
事实证明,我在同一行中有一些 awk似乎找不到的参数,即:
.... time= 1.234 Gflop/s= 3.4556 .....
它过滤第一个,但不过滤 Gflop/s。有没有办法在同一行递归查找?