gpt4 book ai didi

linux - 在 Linux 上用 6 GB 文件中的硬制表符替换空格字符

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:18:50 26 4
gpt4 key购买 nike

我有一个用硬制表符替换空格字符的 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

我怎样才能用 AWK 做到这一点?或 sed

最佳答案

除非你严格要求 sed/awk,否则 tr 是最好的选择:

tr ' ' '\t'  < inputfile > outputfile

关于linux - 在 Linux 上用 6 GB 文件中的硬制表符替换空格字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6715832/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com