AWK で行の先頭に文字列を追加する

published:

AWK で行の先頭に文字列を追加(連結)する。

以下のテキストファイルがあるとする。

$ cat example.txt
123
234
345

テキストファイルの各行の先頭に文字列を追加する。

$ awk '{print "- " $0}' example.txt
- 123
- 234
- 345

Previous Article

Next Article