タイトルありきです。スペースをタブに変換するコマンド[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
お粗末さまでした。