|
Answer» The code was tested with the file BLURBS you posted. I may have goofed the NUMBERS on the set STATEMENTS but you can adjust them.
Previously I misstated that the numbers on the set statements represent offset,position. Actually they represent offset,LENGTH with offset being zero-based. Sorry for any confusion.
Code: [Select]:log for /f "tokens=* delims=" %%i in (%1) do ( set pfx=%1 set pfx=!pfx:~0,3! set str=%%i
if /i !pfx! EQU soc set id=!str:~12,6! if /i !pfx! EQU inv set id=!str:~26,25! if not defined holdid set holdid= if not !id! EQU !holdid! ( echo !id! >> log.txt set holdid=!id! ) ) exit
I assume you've searched the database extension on the NET. Even simple text files can be accessed with the Jet Provider (OLEDB).
Good luck.
|