中国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-09-15 13:32
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS批处理 & 脚本技术(批处理室) » Regarding the issue of replacing special characters in text
Printable Version  2,666 / 6
Floor1 xyzup Posted 2007-01-10 14:08
初级用户 Posts 16 Credits 39
There is a text as follows:
http%3A%2F%2Fxxx.net%2Fxxx.htm

I want to convert all "%3A" to ":"
"%2F" to "/"
Get:http://xxx.net/xxx.htm

Refer to the posts in the forum
http://www.cn-dos.net/forum/viewthread.php?tid=26277&fpage=1&highlight=%E6%96%87%E6%9C%AC###
The replacement statement with set var=%var:%2F=/% failed

Ask if these are special characters??
Also read several posts on special character replacement:
http://www.cn-dos.net/forum/viewthread.php?tid=25692&fpage=1&highlight=%E6%9B%BF%E6%8D%A2
http://www.cn-dos.net/forum/viewthread.php?tid=22245&fpage=1&highlight=%E6%9B%BF%E6%8D%A2
The result is not understandable~!!
Ask how to write it?
Floor2 jmz573515 Posted 2007-01-10 22:53
银牌会员 Posts 464 Credits 1,212
You can write it like this in VBS
Floor3 ccwan Posted 2007-01-10 23:41
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
Batch code is as follows:


[ Last edited by ccwan on 2007-1-10 at 11:57 PM ]
Floor4 vkill Posted 2007-01-11 01:11
金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽
Floor5 ccwan Posted 2007-01-11 01:13
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
Hehe, why doesn't vkill just write out the code?
Floor6 xyzup Posted 2007-01-12 08:23
初级用户 Posts 16 Credits 39
Originally posted by ccwan at 2007-1-10 10:41 AM:
Batch code is as follows:


[ Last ...


Thanks!!
Floor7 xyzup Posted 2007-01-12 08:30
初级用户 Posts 16 Credits 39
Originally posted by ccwan at 2007-1-10 12:13 PM:
Hehe, why doesn't vkill just write out the code?



I posted a thread the other day.. didn't have time to come up and check..
Thanks for the advice....:)

Regarding external commands like sed...
Because using BAT was originally for convenience.. Windows comes with it.. every machine has it..
But switching to something else, maybe more powerful.. but still loses the original intention of convenience.. (because I'm not a DOS fan)

But still thanks to Brother vkill for the attention
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023