China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-12 01:18
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Batch script to remove spaces and extract text View 1,195 Replies 3
Original Poster Posted 2010-08-15 01:16 ·  中国 湖南 张家界 电信
新手上路
Credits 1
Posts 1
Joined 2010-08-09 20:13
16-year member
UID 172074
Gender Male
Status Offline
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
Floor 2 Posted 2010-08-15 08:28 ·  中国 湖南 株洲 电信
初级用户
Credits 27
Posts 12
Joined 2008-04-26 03:58
18-year member
UID 116974
Gender Male
Status Offline
I'll be an expert for once too ^_^

@for /f "tokens=2 delims=//" %%a in ('type a.txt') do echo %%a
Floor 3 Posted 2010-08-15 10:02 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
// and / have the same effect
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Floor 4 Posted 2010-08-15 13:13 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Forum Jump: