タグ

参考とsedに関するsasapurinのブックマーク (1)

  • 仕事支援sed awk

     ファイルの特定フィールドを表示する。【awk】 2番目のフィールドを表示する。 testuser$ cat test.txt aaa bbb ccc ddd eee fff ggg hhh iii testuser$ awk '{print $2}' test.txt bbb eee hhh 区切り文字を指定した上で特定フィールドを表示する。【awk】 区切り文字「,」を指定し、入力ファイルの2番目のフィールドを表示する。 testuser$ cat test.txt aaa aaa, bbb bbb, ccc ccc, ddd ddd, eee eee, fff fff, ggg ggg, hhh hhh, iii iii, testuser$ awk -F, '{print $2}' test.txt bbb bbb eee eee hhh hhh ファイルの各行の先頭に特定の文字

  • 1