LoginSignup
0
3

More than 5 years have passed since last update.

LinuxでCSVファイルの特定の列を取り出す

Last updated at Posted at 2017-10-03

備忘録

cutコマンドを利用してtarget.csvから全行の9列目の項目を取り出す。

cut -d ',' -f 9 target.csv

-d オプションでデリミタを指定する。(デフォルトはタブ)
-f オプションで取り出したい列を指定する。

取り出した内容をファイルに吐き出したい場合は以下のように ">" でリダイレクト。

cut -d ',' -f 9 target.csv >dist.csv
0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3