1
0

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.

「タブエンジニアが少ないとやる気出ない問題」を解決するためにスペースをタブに変換する。

Posted at

タイトルありきです。スペースをタブに変換するコマンド[unexpand]を紹介する。
コードがタブ/スペースで統一されるとやる気が出るかもしれない。
ほとんど情報はここから。https://webkaru.net/linux/unexpand-command/

//qiita-image-store.s3.amazonaws.com/0/104300/62cbf775-29b7-9775-6b85-182dadb1ab03.png)

$ cat foo.txt
1 2 3 4 5
a b c d e


```bash
unexpand foo.txt
$ unexpand foo.txt 
	1       2       3       4       5
	a       b       c       d       e

逆に、タブからスペースにするには、expand なんだ。

Rubyのワンライナーで書くとこんな感じ。

cat a.txt | ruby -e 'STDIN.each {|line| puts line.gsub(/^\s+/,"\t") }'

タイトルや画像の元についてはこちら。
https://logmi.jp/294756

お粗末さまでした。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?