您的位置:首页 > 其它

如何在txt文本每行开头、结尾加入特定的符号

2011-09-26 12:49 525 查看
用工具Replace Pioneer很容易办到,把每行替换成abc$match\n即表示在每行前加abc.不仅如此,

而且能很灵活地解决所有类似的问题。详细步骤:

1. ctrl-o打开文本文件

2. ctrl-h打开Replace对话框把Replace Unit设置成Line在Replace with pattern输入abc$match

3. 点击Replace,完成!

结尾:

用replace pioneer在每行后面添加"新字符"的详细步骤:

1. ctrl-o打开文件

2. ctrl-h打开replace窗口

* replace unit选为Line

* replace with pattern填"${match}新字符"(不带双引号)

3. 点击replace即可。

Replace Pioneer下载:http://www.mind-pioneer.com注意是英文版,但处理中文文档没问题。

另一种方法,用bat语言实现批处理:
@echo off

for /f "delims=" %%i in (123.txt) do (if not defined %%i set %%i=A & echo %%i>>tmp.tmp)

for /f %%i in ('type tmp.tmp') do (echo ^前缀%%i^后缀>>123.txt)

del tmp.tmp
123.txt即为我们需要批量处理的文本。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: