用工具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
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即为我们需要批量处理的文本。