find specific character positions in text fil

September 8, 2010 at 15:59:07
Specs: windows
In a directory I have *.txt files with multiple records in each and I need a batch to read thru all records of all files and output to another text file what is in position 172, length of 8 characters for each record.

A list of order numbers from all records in all files.

Thank you so much for your help, I've been messing around with this hit or miss and I'm so close.

See More: find specific character positions in text fil

Report •

September 8, 2010 at 16:24:06
Found a post by dtech10, and got it working. YAY!

@echo off
setlocal EnableDelayedExpansion
for %%a in (*.txt) do (
for /f "tokens=1 delims=" %%b in (%%a) do (
set rec1=%%b
set ord=!rec1:~172,8!
echo !ord! >> ord.txt

Report •
Related Solutions

Ask Question