中国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-12 00:33
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » [Help] Batch script to remove spaces and extract text
Printable Version  1,194 / 3
Floor1 dujia008 Posted 2010-08-15 01:16
新手上路 Posts 1 Credits 1
Help from the experts / Batch script to remove spaces and extract text, as follows



Recently I wanted to do some online marketing, using search engines to get website addresses, but most of them look like the content below. What I want is this: clean up the domain names below so that only www.XXX.com is left, strip off http://, then process them again to cut off everything after /. Such as /index.php /index.asp /action and so on. If I use Notepad to replace them, for irregular things after / I mostly have to replace them one by one manually. I want to automate it,
http://www.baidu.com/index.php
http://www.sina.com/index.php
http://www.qq.com/index.html
http://www.51.com/index.ph
http://www.google.com/index.php
Floor2 lxzzr Posted 2010-08-15 08:28
初级用户 Posts 12 Credits 27
I'll be an expert for once too ^_^

@for /f "tokens=2 delims=//" %%a in ('type a.txt') do echo %%a
Floor3 slore Posted 2010-08-15 10:02
铂金会员 Posts 2,478 Credits 5,212
// and / have the same effect
Floor4 HAT Posted 2010-08-15 13:13
版主 Posts 5,017 Credits 9,023
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023