Solved Cmd line find for specific value in a 16-digit field

January 16, 2014 at 15:58:07
Specs: Windows 7
I am looking to find a value in a text file (within a .zip) of '9' in a field from position 26-48 in lines beginning with 'A' only. This search would need to cover all files with a three digit indicator i.e. FED in the file name in a directory with many subdirectories.

I know this one is a complicated one but I'm hoping someone can point me in the right direction.

Thanks for your help.

message edited by Naheka

See More: Cmd line find for specific value in a 16-digit field

Report •

January 17, 2014 at 21:03:55
✔ Best Answer
Well, that sure confused me: I don't know what FED is (maybe later I'll try the GOO).
You never said what you wanted done with the output, or what form the output is to take, so I'll just leave that for future resolution.
I made this to try and handle the lowest level of your problem:
::===== snippet ONLY, for testing prototype filtration of input file
@echo off & setlocal enabledelayedexpansion
:: leaving all the debugging junk in play for obvious reasons!
for /f "tokens=*" %%a in ('findstr /R "^A.*"^<nahek') do (
echo INPUTLINE:%%a
set test=%%a
set test=!test:~25,22!
set test2=!test:9=!
echo comparing: [!test!] -- [!test2!]
if "!test2!" neq "!test!" echo NINE %%a
::====== end snippet
Step one: conquer one single, unzipped file. Then you go from there with unzipping and directory recursion, meantime always watching for those exceptions which always seem to crop up in forums.

Report •
Related Solutions

Ask Question