中国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-11 07:09
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » [Help] How to replace the character "%40" in text
Printable Version  960 / 10
Floor1 studenteer Posted 2009-01-27 01:20
新手上路 Posts 3 Credits 3
I have a text file where, for some reason, the decoding was incomplete, so many symbols were not decoded.
I need to replace them manually:

%2A replace with *
%40 replace with @
%2B replace with+
%2C replace with,
In short, all those HTML special character encodings need to be replaced with their corresponding symbols.
There are a whole series of replacements like this, which is very cumbersome.
I came to your forum because of its reputation, hoping to find a solution. Please give me some help, and thanks in advance.
Floor2 slore Posted 2009-01-27 01:41
铂金会员 Posts 2,478 Credits 5,212
Keyword: ASCII

I suggest using some third-party software to handle it.
Floor3 studenteer Posted 2009-01-27 15:21
新手上路 Posts 3 Credits 3
Can you help me solve this problem? Or give me a piece of code
Floor4 slore Posted 2009-01-27 15:30
铂金会员 Posts 2,478 Credits 5,212
bat can't do it; if encoding is supported, the simplest way is to use vbs.

Could you provide a sample text, that is, a snippet from your text?
Floor5 yishanju Posted 2009-01-27 15:53
银牌会员 Posts 1,357 Credits 1,488
If you use the text replacement tool fr,
http://baiy.cn/utils/fr/index.htm

fr test.txt -fic:"%%2A" -t:"*"
fr test.txt -fic:"%%40" -t:"@"
.......

[ Last edited by yishanju on 2009-1-27 at 16:07 ]
Floor6 slore Posted 2009-01-27 17:08
铂金会员 Posts 2,478 Credits 5,212
How many lines would have to be written like this =。= There are usually 86 characters...
Floor7 lxmxn Posted 2009-01-27 17:18
版主 Posts 4,938 Credits 11,386
If you use vim, you can use the following to get it done:
Floor8 BC Posted 2009-01-27 18:08
中级用户 Posts 175 Credits 338
Powerful vim replacement.
Floor9 yishanju Posted 2009-01-27 23:29
银牌会员 Posts 1,357 Credits 1,488
Originally posted by slore at 2009-1-27 17:08:
How many lines would have to be written like this =。= There are usually 86 characters...


-_- My skills are limited,,,, that's the only way I know
If there were a list matching encoded characters to their equivalents, that would be a bit better

[ Last edited by yishanju on 2009-1-27 at 23:44 ]
Floor10 studenteer Posted 2009-01-27 23:41
新手上路 Posts 3 Credits 3
Originally posted by slore at 2009-1-27 15:30:
bat can't do it; if encoding is supported, the simplest way is to use vbs.

Could you provide a sample text, that is, a snippet from your text?


Thanks, brother. With the software you provided, I achieved my goal. Many thanks!
Floor11 slore Posted 2009-01-28 00:10
铂金会员 Posts 2,478 Credits 5,212
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023