|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 46 楼』:
使用 LLM 解释/回答一下
Originally posted by zw19750516 at 2008-7-10 12:09 AM:
是不是我的眼睛出了问题,我把24楼的代码看了n次,就是没看到一个defined,老土,你是不是再看一下啊。
对不起, 应该24楼代码+7楼代码, 看错了.
另外, 你的代码可能多了或者少了括号的问题. 我看不出来.
Last edited by quya on 2008-7-10 at 12:17 AM ]
Originally posted by zw19750516 at 2008-7-10 12:09 AM:
Is there something wrong with my eyes? I've read the code on floor 24 many times, but I can't see a single "defined". Lao Tu, can you take a look again?
Sorry, I should have looked at the code on floor 24 plus the code on floor 7. I made a mistake.
Also, there might be an issue with missing or extra parentheses in your code. I can't tell.
Last edited by quya on 2008-7-10 at 12:17 AM ]
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-7-10 00:11 |
|
|
bat-zw
金牌会员
      永远的学习者
积分 3105
发帖 1276
注册 2008-3-8
状态 离线
|
『第 47 楼』:
使用 LLM 解释/回答一下
我晕,没多也没少啊,我也没看出来。
不想了,睡觉了。
Last edited by zw19750516 on 2008-7-10 at 12:27 AM ]
Oh, there's neither more nor less. I can't see it either.
Don't think about it anymore, going to sleep.
Last edited by zw19750516 on 2008-7-10 at 12:27 AM ]
|

批处理之家新域名:www.bathome.net |
|
2008-7-10 00:23 |
|
|
26933062
银牌会员
    
积分 2268
发帖 879
注册 2006-12-19
状态 离线
|
『第 48 楼』:
使用 LLM 解释/回答一下
39楼的代码对1.txt循环的次数等于2.txt的行数乘以1.txt的行数,所以效率会低的多。
Last edited by 26933062 on 2008-7-10 at 12:31 AM ]
The number of loops for the code on floor 39 to 1.txt is equal to the number of lines in 2.txt multiplied by the number of lines in 1.txt, so the efficiency is much lower.
Last edited by 26933062 on 2008-7-10 at 12:31 AM ]
|

致精致简! |
|
2008-7-10 00:30 |
|
|
26933062
银牌会员
    
积分 2268
发帖 879
注册 2006-12-19
状态 离线
|
『第 49 楼』:
使用 LLM 解释/回答一下
楼主问题解决了吗?
Has the thread starter solved the problem?
|

致精致简! |
|
2008-7-10 00:46 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 50 楼』:
使用 LLM 解释/回答一下
Originally posted by 26933062 at 2008-7-10 12:30 AM:
楼主问题解决了吗?
你号称初中都没毕业, 现在打死我也不相信了. 初中没毕业程序会写得这么溜? 把我这个号称大学以上文化的人忽悠得晕头转向.
要是我年轻十岁, 我估计我不会来这求助的, 难为情啊. 大不了搞个通宵把所有命令吃透了再想办法, 可是年纪大了,确实不行了.
睡觉了, 今天又学到不少东西. 活到老学到老. 谢谢各位!
Last edited by quya on 2008-7-10 at 12:52 AM ]
Originally posted by 26933062 at 2008-7-10 12:30 AM:
Has the landlord's problem been solved?
You claimed that you didn't even graduate from junior high school, but now I simply can't believe it. How can someone who didn't graduate from junior high school write programs so skillfully? You've confused me, someone who claims to have at least a college education, completely.
If I were ten years younger, I don't think I would come here for help. It's embarrassing. At most, I would stay up all night to thoroughly understand all the commands and then figure out a way, but I'm getting old, and indeed, I can't do it anymore.
Going to sleep now. I've learned a lot today. One learns until one dies. Thanks everyone!
Last edited by quya on 2008-7-10 at 12:52 AM ]
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-7-10 00:48 |
|
|
terse
银牌会员
    
积分 2404
发帖 946
注册 2005-9-8
状态 离线
|
『第 51 楼』:
使用 LLM 解释/回答一下
还是小楼兄的好看
把你的加上比较
@echo off&setlocal enabledelayedexpansion
for /f "tokens=1*" %%i in (1.txt) do set "%%j=%%i"
for /f "delims=" %%a in (2.txt) do (
if /i "%%~xa"==".cat" (
for /f "tokens=1*" %%i in ('crc32 %%~fsa') do if defined %%j >>crc.txt echo !%%j! %%j %%i)else (
expand %%~fsa %temp%\%%~na.cat
for /f "tokens=1*" %%i in ('crc32 %temp%\%%~na.cat') do if defined %%j >>crc.txt echo !%%j! %%j %%~fsa
))
pause
Still, Xiao Lou's looks better. Compare with yours.
@echo off&setlocal enabledelayedexpansion
for /f "tokens=1*" %%i in (1.txt) do set "%%j=%%i"
for /f "delims=" %%a in (2.txt) do (
if /i "%%~xa"==".cat" (
for /f "tokens=1*" %%i in ('crc32 %%~fsa') do if defined %%j >>crc.txt echo !%%j! %%j %%i)else (
expand %%~fsa %temp%\%%~na.cat
for /f "tokens=1*" %%i in ('crc32 %temp%\%%~na.cat') do if defined %%j >>crc.txt echo !%%j! %%j %%~fsa
))
pause
|

简单!简单!再简单! |
|
2008-7-10 01:01 |
|
|
26933062
银牌会员
    
积分 2268
发帖 879
注册 2006-12-19
状态 离线
|
『第 52 楼』:
使用 LLM 解释/回答一下
又看了下顶楼的描述,楼主的这句话。
现在我得到一个变量值,比如 HEDY,是在文件 1.txt中的行的第一个值。
我对2.txt中路径中的文件(如果是压缩文件则先EXPAND)进行CRC32 校验, 运行 CRC32.EXE, 假定得到的CRC 输出结果在第一行第2个Token, 然后和文件 1.txt第2行值比较,IF FIND, 则把对应的路径赋值给一个变量。
好像是要根据一个变量的值来查找需要的文件名,而不是全部对比。
如下:str的值就是需要查找的。可以是多个,用空格分开。
:
@echo off&setlocal enabledelayedexpansion
set str=HEDY LEGEND
for /f "tokens=1* delims= " %%a in (1.txt) do set "%%a=%%b"
for /f "delims==" %%i in (2.txt) do (
if /i %%~xi==.cat (
for /f "delims=" %%j in ('crc32 %%~fsi') do set "var=%%j"
) else (
expand %%~fsi %temp%\oembios.cat
for /f "tokens=2" %%j in ('crc32 %temp%\oembios.cat') do set "var=%%j"
del/q %temp%\oembios.cat >nul 2>nul
)
for %%a in (%str%) do if /i "!var!"=="!%%a!" echo %%a !var! %%i
)
pause
Last edited by 26933062 on 2008-7-10 at 01:21 AM ]
I took another look at the description in the top post, the original poster's sentence.
Now I get a variable value, such as HEDY, which is the first value in the line in file 1.txt.
I perform a CRC32 check on the files in the path in 2.txt (if it's a compressed file, first EXPAND it), run CRC32.EXE, assume that the CRC output result is the second Token in the first line, and then compare it with the value in the second line of file 1.txt. IF FIND, then assign the corresponding path to a variable.
It seems to be to find the required file name according to the value of a variable, not to compare all.
The following: the value of str is the one to be found. It can be multiple, separated by spaces.
:
@echo off&setlocal enabledelayedexpansion
set str=HEDY LEGEND
for /f "tokens=1* delims= " %%a in (1.txt) do set "%%a=%%b"
for /f "delims==" %%i in (2.txt) do (
if /i %%~xi==.cat (
for /f "delims=" %%j in ('crc32 %%~fsi') do set "var=%%j"
) else (
expand %%~fsi %temp%\oembios.cat
for /f "tokens=2" %%j in ('crc32 %temp%\oembios.cat') do set "var=%%j"
del/q %temp%\oembios.cat >nul 2>nul
)
for %%a in (%str%) do if /i "!var!"=="!%%a!" echo %%a !var! %%i
)
pause
Last edited by 26933062 on 2008-7-10 at 01:21 AM ]
|

致精致简! |
|
2008-7-10 01:11 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 53 楼』:
使用 LLM 解释/回答一下
Originally posted by quya at 2008-7-9 13:53:
我电脑装了VOL版的XP,现在我想改成OEM版的, 我的主板具备了OEM特征, 我有一大堆OEMBIOS文件可用来替换系统所需要的文件。 为了查找准确的OEMBIOS文件, 我把它们放在一个个特定的文件夹中以便程序来自动寻找。
有点乱七八糟我就上述问题给你解决方法(需要crc32sum.exe)
@echo off
for /f "delims=" %%a in ('dir /s/a-d/b D:\*.CA*') do call :xxx "%%a"
pause
:xxx
set "FliePath=%~dp1"
set "Flie=%~nx1"
if "%Flie:~-1%"=="_" (
EXPAND "%~1" "%temp%\OEMBIOS.CAT" >nul
for /f "tokens=1 delims=* " %%i in ('crc32sum.exe -b "%temp%\OEMBIOS.CAT"') do set "crc32=%%i"
) else (
for /f "tokens=1 delims=* " %%i in ('crc32sum.exe -b "%~1"') do set "crc32=%%i"
)
for /f "tokens=1 delims= " %%k in ('type 1.txt^|find /i "%crc32%"') do echo 文件"%~1" 对应品牌%%k
功能描述
枚举D盘CA*扩展名,如果扩展名是CA_就用EXPAND解压到临时文件夹再crc32sum.exe校验,否则直接crc32sum.exe校验,将校验值赋予变量crc32,最后筛选OEM显示结果
crc32sum.exe请到我的网盘下载
http://fastslz.cech.com.cn/#show=file
这个是我的执行结果
文件"D:\oembios\XP_ACER_OEM\OEMBIOS.CA_" 对应品牌Acer
文件"D:\oembios\XP_ASUS_OEM\OEMBIOS.CA_" 对应品牌Asus
文件"D:\oembios\XP_COMPAQ_OEM\OEMBIOS.CA_" 对应品牌Compaq
文件"D:\oembios\XP_DELL_OEM\OEMBIOS.CA_" 对应品牌Dell
文件"D:\oembios\XP_HP_OEM\OEMBIOS.CA_" 对应品牌Hewlett-Packard
文件"D:\oembios\XP_IBM_OEM\OEMBIOS.CA_" 对应品牌IBM
文件"D:\oembios\XP_IBM_OEM\OEMBIOS.CA_" 对应品牌IBM
文件"D:\oembios\XP_Lenovo_OEM\OEMBIOS.CA_" 对应品牌LEGEND
文件"D:\oembios\XP_Lenovo_OEM\OEMBIOS.CA_" 对应品牌LEGEND
文件"D:\oembios\XP_SONY_OEM\OEMBIOS.CA_" 对应品牌Sony
请按任意键继续. . .
Originally posted by quya at 2008-7-9 13:53:
I have installed the VOL version of XP on my computer. Now I want to change it to the OEM version. My motherboard has OEM characteristics, and I have a large number of OEM BIOS files available to replace the files required by the system. To find the accurate OEM BIOS files, I put them in specific folders one by one so that the program can automatically find them.
It's a bit messy. I'll give you a solution for the above problem (requires crc32sum.exe)
@echo off
for /f "delims=" %%a in ('dir /s/a-d/b D:\*.CA*') do call :xxx "%%a"
pause
:xxx
set "FliePath=%~dp1"
set "Flie=%~nx1"
if "%Flie:~-1%"=="_" (
EXPAND "%~1" "%temp%\OEMBIOS.CAT" >nul
for /f "tokens=1 delims=* " %%i in ('crc32sum.exe -b "%temp%\OEMBIOS.CAT"') do set "crc32=%%i"
) else (
for /f "tokens=1 delims=* " %%i in ('crc32sum.exe -b "%~1"') do set "crc32=%%i"
)
for /f "tokens=1 delims= " %%k in ('type 1.txt^|find /i "%crc32%"') do echo 文件"%~1" 对应品牌%%k
Function description: Enumerate CA* extensions on drive D. If the extension is CA_, use EXPAND to extract to the temporary folder and then use crc32sum.exe to verify. Otherwise, directly use crc32sum.exe to verify. Assign the verification value to the variable crc32. Finally, filter and display the OEM results. crc32sum.exe can be downloaded from my cloud disk.
http://fastslz.cech.com.cn/#show=file
This is my execution result
File "D:\oembios\XP_ACER_OEM\OEMBIOS.CA_" corresponds to brand Acer
File "D:\oembios\XP_ASUS_OEM\OEMBIOS.CA_" corresponds to brand Asus
File "D:\oembios\XP_COMPAQ_OEM\OEMBIOS.CA_" corresponds to brand Compaq
File "D:\oembios\XP_DELL_OEM\OEMBIOS.CA_" corresponds to brand Dell
File "D:\oembios\XP_HP_OEM\OEMBIOS.CA_" corresponds to brand Hewlett-Packard
File "D:\oembios\XP_IBM_OEM\OEMBIOS.CA_" corresponds to brand IBM
File "D:\oembios\XP_IBM_OEM\OEMBIOS.CA_" corresponds to brand IBM
File "D:\oembios\XP_Lenovo_OEM\OEMBIOS.CA_" corresponds to brand LEGEND
File "D:\oembios\XP_Lenovo_OEM\OEMBIOS.CA_" corresponds to brand LEGEND
File "D:\oembios\XP_SONY_OEM\OEMBIOS.CA_" corresponds to brand Sony
Press any key to continue. . .
|

第一高手 第二高手
我的小站
 |
|
2008-7-10 17:12 |
|