ChinaUnix.net
相关文章推荐:

vim 替换文本tab为空格

请问,想把.c文件中的tab转换成4个空格,使用sed如何写一个转换语句??

by qbin_wang - Shell - 2007-09-29 22:35:13 阅读(1774) 回复(2)

相关讨论

希望由本地机器给出变量,然后ssh到远程机器上进行变量替换,具体如下: old="old string" //$old中可能有空格或者tab键 new="new string" //$new中可能有空格或者tab键 ssh a "sed "s/$old/$new/g" test_file" //登陆到机器a上对文件test_file进行内容替换,在ssh中的sed应该如何写呢,关键是变量$old,$new完全由用户给出,是含有空格还是tab并不确定 谢谢各位大侠!

by demil - Shell - 2008-10-14 23:36:45 阅读(1300) 回复(1)

sed 's/\t/ /g' a.txt 好像不行,\t被当作字母t了

by goodier - Shell - 2008-08-19 13:31:44 阅读(5783) 回复(15)

如题: 即有字符串: str="111 222 333" 想将分隔的空格替换tab 在sco中执行 echo $str | sed -e 's/ /\t/g' 结果 111t222t333 不是想要的 111 222 333 (中间tab)

by novemberrain - Shell - 2007-01-08 16:12:31 阅读(1794) 回复(3)

举个例子: 原文件: [code]aaaa bb cc ddd ee f gg hhhhhhhhhhhhhhhhhh[/code] 运行后: [code]aaaa bb cc ddd ee f gg hhhhhhhhhhhhhhhhhh[/code] 多谢多谢!!

by maxx - Shell - 2004-04-13 17:28:13 阅读(2710) 回复(7)

举个例子: 原文件: aaaa bb cc ddd ee f gg hhhhhhhhhhhhhhhhhh 目标: aaaa bb cc ddd ee f gg hhhhhhhhhhhhhhhhhh 多谢了!!

by maxx - Linux论坛 - 2004-04-13 07:56:12 阅读(2561) 回复(10)

RT! 在论坛里搜了一下没发现!

by nmgzw - C/C++ - 2006-02-06 04:37:25 阅读(2522) 回复(7)

怎么将N多文件中的$$字符 替换tab制表符 多谢各位

by sunsansheng - Shell - 2009-08-19 12:56:50 阅读(1601) 回复(9)

想用tab替换& cat file1 &111111111&222222222&3333333333 sed -e 's/&/\t/g' file1 > file2 vim file2 显示是 111111111 222222222 3333333333 但是上面结果file2实际上是space 1111111 tab space 22222222 tab space 33333333 希望能让file2是 tab 1111111 tab 22222222 tab 33333333 请问下要如何实现

by lingg - Shell - 2008-06-02 09:50:09 阅读(2811) 回复(4)
by bigsunflower - 其他UNIX - 2004-09-06 13:10:11 阅读(1818) 回复(4)