14
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

joinコマンドでtab区切りファイルを扱う

Last updated at Posted at 2014-06-26

SQLのJOIN的なことがコマンドだけで出来てしまう便利なjoinコマンド。
スペース区切りならそのまま、CSVなら-t ,で出来るけど、タブ区切りは-t "\t"-t '\t'ではうまく行かない。

コンソールからそのまま打てるなら、-t '<tab>キー'とキーを実際に押す。
制御コマンドが押せないようになっているなら、-t '<Ctrl+v><tab>キー'で対応可能。

コメントより:
-t "$(printf '\011')" も使えます。この方がスマート!

14
13
3

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
14
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?