Help us understand the problem. What is going on with this article?

mac OSX で sedを使ってtabの文字列を置換

More than 5 years have passed since last update.

MacOSX上でsedを利用して、tab文字の置換をやろうとして、つまづいたのでメモ。

sed -e 's/\t/\"\t\"/g' 20130911.tsv >> 20130911_2.tsv

とかしてみたけど、全然効かず。
いろいろやってみて効いた方法が

sed -e 's/<C-v><tab>/\"<C-v><tab>\"/g' 20130911.tsv >> 20130911_2.tsv

 C-v → Ctr-v
 tab → 普通にTABキー

これで実行したら出来た。
MacOS上だけなのかなー。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away