mad*_*tty 1 linux vi awk replace sed
我有一个vi命令,用硬标签替换空格字符:
vi myfile.txt
: # To go to the last line
1,$s/ /\t/g # Then I type in this to replace spaces by a tab
Run Code Online (Sandbox Code Playgroud)
除非你严格要求sed/ awk,否则tr它是最好的选择:
tr ' ' '\t' < inputfile > outputfile
Run Code Online (Sandbox Code Playgroud)