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-07-14 23:27
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to read specified values from this txt? View 2,761 Replies 13
Original Poster Posted 2007-01-18 05:51 ·  中国 辽宁 大连 联通
初级用户
Credits 86
Posts 31
Joined 2007-01-09 13:30
19-year member
UID 75960
Gender Male
Status Offline
Already done...Thanks to lxmxn's answer and all the friends who paid attention downstairs. ccwan is very enthusiastic. Thanks~

There is a.txt, the content is as follows:
Windows Registry Editor Version 5.00


@=hex(3ef):


That is, there are three empty lines. Please solve how to read the 3ef value in this txt??
Tried several times, still not working


Why do I always say it unclear every time, sorry
I want to use this batch processing echo 3ef value, not successful
for /f "eol=






Last edited by FBOAR on 2007-1-17 at 06:33 PM ]
Floor 2 Posted 2007-01-18 06:08 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
Can you be more specific?
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 3 Posted 2007-01-18 06:09 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 4 Posted 2007-01-18 06:11
中级用户
★★
DOS之日
Credits 337
Posts 161
Joined 2006-11-04 05:27
19-year member
UID 69523
Gender Male
Status Offline
Don't understand, just read out 3ef?

[ Last edited by hxuan999 on 2007-1-17 at 06:12 PM ]
for /f %%h in (`echo hxuan`) do for /f %%x in (`echo hxuan`) do if %%h==%%x nul
Floor 5 Posted 2007-01-18 06:12 ·  中国 北京 朝阳区 联通
高级用户
★★
朦胧的世界
Credits 579
Posts 218
Joined 2006-10-24 04:29
19-year member
UID 67972
Status Offline
Multiple methods.

for+more
for+findstr
for skip
findstr+variable interception.....

认识自己,降伏自己,改变自己
,才能改变别人!
Floor 6 Posted 2007-01-18 06:14 ·  中国 江苏 苏州 联通
银牌会员
★★★
Credits 1,181
Posts 533
Joined 2006-08-14 12:54
19-year member
UID 60484
Status Offline
The owner of the post should make the reading "rules" clear. Otherwise, there may be N kinds of solutions, but not necessarily all can truly meet your requirements.
Floor 7 Posted 2007-01-18 06:24 ·  中国 辽宁 大连 联通
初级用户
Credits 86
Posts 31
Joined 2007-01-09 13:30
19-year member
UID 75960
Gender Male
Status Offline
It's okay, you've made an edit.
Floor 8 Posted 2007-01-18 06:25 ·  中国 北京 联通
银牌会员
★★★
努力做坏人
Credits 1,185
Posts 438
Joined 2006-08-28 12:00
19-year member
UID 61449
From 北京
Status Offline
Just follow the file from the original poster, the following code should work

for /f "tokens=3 delims==()" %a in (test.reg) do @echo %a
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
FBOAR +2 2007-01-18 07:31
我今后在论坛的目标就是做个超级坏人!!!
Floor 9 Posted 2007-01-18 06:37 ·  中国 辽宁 大连 联通
初级用户
Credits 86
Posts 31
Joined 2007-01-09 13:30
19-year member
UID 75960
Gender Male
Status Offline
It seems that the one upstairs doesn't work. I tried it.
Floor 10 Posted 2007-01-18 06:39 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 11 Posted 2007-01-18 06:42 ·  中国 北京 朝阳区 联通
高级用户
★★
朦胧的世界
Credits 579
Posts 218
Joined 2006-10-24 04:29
19-year member
UID 67972
Status Offline
for /f "eol=[ tokens=2 delims=()" %%i in (a.txt) do set d=%%i
echo %d%
pause
Why didn't it succeed? What's the prompt?
@=hex(3ef):There's nothing below, right.

认识自己,降伏自己,改变自己
,才能改变别人!
Floor 12 Posted 2007-01-18 06:53 ·  中国 辽宁 大连 联通
初级用户
Credits 86
Posts 31
Joined 2007-01-09 13:30
19-year member
UID 75960
Gender Male
Status Offline
Originally posted by tao0610 at 2007-1-17 05:42 PM:
for /f "eol=




--- There are two blank lines

Return
echo is in the open state
The variables in the following path are also invalid

I wrote this. Everyone can try exporting the username guest
reg export "HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\Names\guest" c:\a.reg
for /f "eol=



Floor 13 Posted 2007-01-18 08:21 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
HKLM\SAM is a secure path, and access cannot be obtained without modifying settings.

for /f "tokens=3" %%i in ('reg query "HKLM\SAM\SAM\DOMAINS\ACCOUNT\USERS\NAMES\GUEST" /ve^|find "No name"') do (
for /f "tokens=2 delims=x" %%j in ("%%i") do set a=%%b)
Floor 14 Posted 2007-05-08 14:32 ·  中国 广东 中山 电信
初级用户
★★
Credits 127
Posts 62
Joined 2007-04-19 12:43
19-year member
UID 85744
Gender Male
Status Offline
for /f "tokens=2 delims=()" %a in (test.reg) do @echo %a This is easier to understand!
Forum Jump: