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-06-25 11:09
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to combine FOR loops with findstr? View 4,610 Replies 25
Floor 16 Posted 2010-12-10 19:47 ·  中国 江苏 无锡 电信
初级用户
Credits 34
Posts 30
Joined 2010-12-02 01:43
15-year member
UID 178698
Gender Male
Status Offline
Really thank you~~~
I almost lost confidence, and I still need you to help explain
What does more +2 han_1.txt>han_2.txt mean?
When the program executes this command, there is no content in han_2.txt~
set/p k=<han_2.txt
set k=%k:*:=%
What does this mean?
echo %k:~1% >bios.dat
What does this mean?

Can you teach me again? Thanks a lot~

[ Last edited by van416 on 2010-12-10 at 19:49 ]
Floor 17 Posted 2010-12-10 20:22 ·  中国 江苏 苏州 联通
初级用户
Credits 34
Posts 30
Joined 2010-12-02 01:43
15-year member
UID 178698
Gender Male
Status Offline
Please help me take a look again, thank you
Floor 18 Posted 2010-12-12 12:02 ·  中国 江苏 无锡 电信
初级用户
Credits 34
Posts 30
Joined 2010-12-02 01:43
15-year member
UID 178698
Gender Male
Status Offline
I have looked through many websites and found that MS-DOS 7.0 does not support more +2 han_1.txt>han_2.txt.

Is there any other way to save the target? Thanks~~
Floor 19 Posted 2010-12-12 12:12 ·  中国 吉林 长春 电信
初级用户
枫中残雪
Credits 65
Posts 43
Joined 2010-04-29 23:20
16-year member
UID 165810
Gender Male
From 吉林省长春市
Status Offline
I don't know if the next tool kit will be useful.
Floor 20 Posted 2010-12-12 12:18 ·  中国 江苏 无锡 电信
初级用户
Credits 34
Posts 30
Joined 2010-12-02 01:43
15-year member
UID 178698
Gender Male
Status Offline
Can the sed tool be used?
Floor 21 Posted 2010-12-12 12:21 ·  中国 吉林 长春 电信
初级用户
枫中残雪
Credits 65
Posts 43
Joined 2010-04-29 23:20
16-year member
UID 165810
Gender Male
From 吉林省长春市
Status Offline
To be honest, I really don't know about DOS. If it's in the tool kit, of course it can be used. SED is also an external command under CMD and still needs to be downloaded.
Floor 22 Posted 2010-12-12 12:22 ·  中国 江苏 无锡 电信
初级用户
Credits 34
Posts 30
Joined 2010-12-02 01:43
15-year member
UID 178698
Gender Male
Status Offline
I just downloaded one, but unfortunately don't know how to use it
Floor 23 Posted 2010-12-12 12:26 ·  中国 吉林 长春 电信
初级用户
枫中残雪
Credits 65
Posts 43
Joined 2010-04-29 23:20
16-year member
UID 165810
Gender Male
From 吉林省长春市
Status Offline
Floor 24 Posted 2010-12-12 12:30 ·  中国 江苏 无锡 电信
初级用户
Credits 34
Posts 30
Joined 2010-12-02 01:43
15-year member
UID 178698
Gender Male
Status Offline
Thank you so much, I'll take a look first
Floor 25 Posted 2010-12-12 12:34 ·  中国 江苏 无锡 电信
初级用户
Credits 34
Posts 30
Joined 2010-12-02 01:43
15-year member
UID 178698
Gender Male
Status Offline
Using sed -n "/Project/p" 1.ini > han_1.txt has already allowed saving a line from Project into han_1.txt.

Content of han_1.txt:
Project : 1060-0011

Next step, only display the characters 1060-0011 from han_1.txt?
Floor 26 Posted 2010-12-12 18:14 ·  中国 江苏 无锡 电信
初级用户
Credits 34
Posts 30
Joined 2010-12-02 01:43
15-year member
UID 178698
Gender Male
Status Offline
sed -n "/^Sign/p" bios.ini >han_1.txt
sed "s/Sign-On Message : //" han_1.txt > bios.dat

Thanks to 726842270 and Hanyeguxing! The above two lines can solve this problem
Forum Jump: