動作確認
CentOS 6.5
test.dat
1,2,3,4
2,2;3,4
3:2,3,4
というファイルがあるとする。この2列目と3列目を取りたい時は以下のようにする。
$awk -F "[,:]" '{print $2, $3}' test.dat
2 3
2 3
2 3
"[,:]"
は複数の区切り文字を指定しており、","
と":"
を区切りと認識する。
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
動作確認
CentOS 6.5
1,2,3,4
2,2;3,4
3:2,3,4
というファイルがあるとする。この2列目と3列目を取りたい時は以下のようにする。
$awk -F "[,:]" '{print $2, $3}' test.dat
2 3
2 3
2 3
"[,:]"
は複数の区切り文字を指定しており、","
と":"
を区切りと認識する。
Register as a new user and use Qiita more conveniently
Go to list of users who liked