标题: 【已解决】【Rmb20】在纯DOS下确认文件内容是否包含指定字符 [打印本页]
作者: 悟咎书生 时间: 2016-9-28 09:44 标题: 【已解决】【Rmb20】在纯DOS下确认文件内容是否包含指定字符
报酬:20元人民币;
支付方式:支付宝,微信、其他等值虚拟产品。
运行环境:MS-DOS (非windows 下的CMD 命令)
在纯DOS环境下要确认文本内的“ SN = 00 E0 4C 68 00 00 00 01” 是否一直保持一致没有发生变化。
比如有文本:A.TXT,B.TXT,C.TXT ,D.TXT等等...
里面要确认存在 “ SN = 00 E0 4C 68 00 00 00 01”
当保持一致的时候显示 PASS; 当不一致时显示 Fail 停住。
PS. 在纯DOS下 For 命令不能使用/F- *************************************************************************
- * PG8168 - EEPROM/EFUSE Programming Utility for *
- * Realtek RTL8168 Family Ethernet Controller *
- * Version : 2.41.0.4 *
- * Copyright (C) Realtek Semiconductor Corp. 2012. All Rights Reserved. *
- *************************************************************************
-
- This is RTL8168EL
- Use EFuse
- Start to Dump and Parse EFuse Content
- FF FF FF FF FF FF FF FF 18 05 03 18 54 60 18 48
- 02 1B 00 00 30 18 CE 19 04 B0 9E 50 2C EC 10 50
- 2E 68 81 18 51 00 18 52 0F 18 53 3C 18 55 14 18
- 56 82 50 42 C3 FF 40 30 00 18 F0 3F 71 64 00 E0
- 4C 68 71 68 00 00 00 01 19 18 28 04 40 18 04 19
- 4C 2C 02 FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
- FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FE
- NODEID = 00 30 18 CE B0 9E
- SVID = 10 EC
- SMID = 81 68
- CONFIG0 = 00
- CONFIG1 = 0F
- CONFIG2 = 3C
- CONFIG3 = 60
- CONFIG4 = 14
- CONFIG5 = 82
- PMC = C3 FF
- ROMBAR = 00
- ROMCONF = 3F
- SN = 00 E0 4C 68 00 00 00 01
- LEDCFG = 04 28
- Efuse Write Count = 1
- PG Version (EFUSE) = V2.44
- EFuse Remain 105 Bytes!!!
复制代码
主要是要确认如该代码内的35行 SN的部分是否是 SN = 00 E0 4C 68 00 00 00 01
要确认的文本内容如:
如果可以帮忙写的请联系我QQ:82198770
RMB 20元,可以微信或者支付宝支付。 也可充值QQ币,会员等...
作者: 523066680 时间: 2016-9-28 12:00
只能用批处理不能写C语言吗?我记得有个Turbo C编译器是跑在DOS上面的
作者: aa77dd@163.com 时间: 2016-9-28 20:42
回复 1# 悟咎书生
测试于 MS-DOS 6.22
FOR /F , 复合语句, FOR 变量做非ECHO命令参数, EXIT , 2>nul , && || 都不能用- @ECHO OFF
-
- C:
-
- IF NOT EXIST *.TXT GOTO :NOTXT
-
- >RESULT CD.
- FOR %%A IN (*.TXT) DO >>RESULT FIND /C /I "SN = 00 E0 4C 68 00 00 00 01" %%A
-
- FIND /I ".TXT: 0" RESULT
-
- IF ERRORLEVEL 1 GOTO :PASS
-
- :FAIL
- ECHO FAIL
- ECHO;ANY KEY TO EXIT...
- >NUL PAUSE
- GOTO :EOF
-
- :PASS
- ECHO;PASS
- ECHO;ANY KEY TO EXIT...
- >NUL PAUSE
- GOTO :EOF
-
- :NOTXT
- ECHO;NO ANY TXT FILE!
- ECHO;ANY KEY TO EXIT...
- >NUL PAUSE
- GOTO :EOF
复制代码
作者: 悟咎书生 时间: 2016-9-29 13:33
回复 3# aa77dd@163.com
谢谢!已经完成测试。
作者: 悟咎书生 时间: 2016-9-29 13:34
回复 2# 523066680
可以,已经有朋友加我QQ,帮忙用批处理写完成了。谢谢!
作者: 悟咎书生 时间: 2016-9-29 13:38
- @ECHO OFF
-
- C:
- cd lansn
-
- IF NOT EXIST *.TXT GOTO :NOTXT
-
- >RESULT CD.
- FOR %%A IN (*.TXT) DO >>RESULT FIND /C /I "SN = 00 E0 4C 68 00 00 00 01" %%A
-
- FIND /I ".TXT: 0" RESULT
-
- IF ERRORLEVEL 1 GOTO :PASS
-
- :FAIL
- @echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- @echo XX XX
- @echo XX FFFFFFFFF AAAA IIIIIIIII LL XX
- @echo XX FF AA AA II LL XX
- @echo XX FF AA AA II LL XX
- @echo XX FF AA AA II LL XX
- @echo XX FFFFFFFFF AA AA II LL XX
- @echo XX FF AAAAAAAA II LL XX
- @echo XX FF AA AA II LL XX
- @echo XX FF AA AA II LL XX
- @echo XX FF AA AA IIIIIIIII LLLLLLLL XX
- @echo XX XX
- @echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- ECHO;ANY KEY TO EXIT...
- >NUL PAUSE
- GOTO :end
-
- :PASS
- @echo 00000000000000000000000000000000000
- @echo 00 00
- @echo 00 PASS 00
- @echo 00 00
- @echo 00000000000000000000000000000000000
- ECHO;ANY KEY TO EXIT...
- >NUL PAUSE
- GOTO :end
-
- :NOTXT
- @echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- @echo XX XX
- @echo XX NO ANY TXT FILE! XX
- @echo XX XX
- @echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- ECHO;ANY KEY TO EXIT...
- >NUL PAUSE
- GOTO :end
-
- :end
- exit
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |