You are not logged in.
Pages: 1
Pease Help me...
I want to find "string" based on database file(*.db) or txtfile.
example .dbfile :
A34DC2 : File1
C234FF : File2
C334eF : File3
etc..
assumption : name of file with ID:a34dc2 is File1
like a crc32 searchmethod..
Q: how about it's code ?
G-Smart thing Smart
Offline
I'm guessing this is the sort of thing you're after:
** UNTESTED **
@echo off
set file=%~nx1
set data=data.txt
set match=
for /f "usebackq tokens=1* delims=: " %%a in ("%data%") do if /i "%%~b" EQU "%file%" set match=%%~a
if defined match (echo:CRC = %match%) ELSE (echo:No match for %file%)
What you'd do is save the above as a .cmd file and run it with a file name as a parameter.
IE: crcfind.cmd File1
Last edited by bluesxman (25 May 2007 15:20)
cmd | *sh | ruby | chef
Offline
Thanks bluesxman..
but I have new Q: how to get crc of file using batch command (same as checksum in vb)
I'am sorry if my question is very stupid..I just a newbie and I want to know more about BatScripting..:)
G-Smart thing Smart
Offline
There are no native commands with which to generate a CRC. You'd have to use a third party app or dip into a more powerful language, such as VB.
cmd | *sh | ruby | chef
Offline
Pages: 1