【发布时间】:2011-10-28 13:12:34
【问题描述】:
需要与本文 (Find and replace a particular term in multiple files) 类似的解决方案,但要在每个分隔制表符文本文件的第一列中替换标点符号。
例子:
file1.txt
afile2.txt
3file.txt
...
所有其他文件名都以 .txt 结尾
txt 文件的格式在列之间有一个“制表符”,如下所示:
aaaa:bbb second_column third_column
w:xyz another_second_column another_third_column
我需要将第一列中的: 替换为另一个字符,例如##。
请帮忙。
perl 是否将: 字符视为列切割器?
【问题讨论】:
-
根据你的 cmets,我感觉你在问The Wrong Question。为什么要删除冒号?它不是 perl 中的元字符。
标签: perl replace punctuation