中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-07 18:09
48,041 topics / 350,128 posts / today 3 new / 48,252 members
DOS批处理 & 脚本技术(批处理室) » [fixed] Looking for a tool to batch replace characters in text
Printable Version  928 / 5
Floor1 tireless Posted 2008-03-09 21:41
银牌会员 Posts 1,122 Credits 2,025
Replace multiple characters in text
Replace Search.gif with http://tireless.blogbus.com/files/12050652183.gif
Replace SR.gif with http://tireless.blogbus.com/files/12050652185.gif
...many more

[ Last edited by tireless on 2008-11-29 at 20:22 ]
Floor2 HAT Posted 2008-03-09 21:46
版主 Posts 5,017 Credits 9,023
Search the forum for "change"
Floor3 suntb Posted 2008-03-09 21:52
高级用户 Posts 277 Credits 581
Searching more is the proper way

http://www.cn-dos.net/forum/viewthread.php?tid=17395

http://www.cn-dos.net/forum/viewthread.php?tid=17669

[ Last edited by suntb on 2008-3-9 at 09:54 PM ]
Floor4 tireless Posted 2008-03-09 22:34
银牌会员 Posts 1,122 Credits 2,025
Many thanks. But it's still very troublesome, I have to write 32 lines like this
CHANGE.EXE test.txt /from BlueTop.gif /to http://www.blogbus.com/user/images/s.gif
Floor5 HAT Posted 2008-03-10 00:30
版主 Posts 5,017 Credits 9,023
Originally posted by tireless at 2008-3-9 10:34 PM:
Many thanks. But it's still very troublesome, I have to write 32 lines like this
CHANGE.EXE test.txt /from BlueTop.gif /to http://www.blogbus.com/user/images/s.gif

Why not put the from content and the to content into a text file, then read that file in a for loop, and call change?
Floor6 ceii Posted 2008-03-12 13:29
初级用户 Posts 45 Credits 115
I often need to do character replacement on several thousand web page files. Back then, all the tools I found had graphical interfaces, and doing this kind of thing was simply a nightmare.
Until one day I found the command-line tool sed, only a few dozen KB in size. What used to be a huge project suddenly became child's play from then on—one command, ten seconds!

sed -i "s/原字符/新字符/g" *.htm
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023