Batch program for extracting ASCII data

March 8, 2010 at 13:45:54
Specs: Windows XP
I am trying to write a batch file that will extract
a specific piece of data from a number of
different output files.

for example, i have files labelled 01.txt 02.text
etc. and i need to extract the number on line
x, ignoring all other data before and after. any
suggestions?


See More: Batch program for extracting ASCII data

Report •

#1
March 8, 2010 at 15:43:43
@echo off & setLocal enableDELAYedeXpansion

set X=3

for /f "tokens=* delims= " %%a in ('dir/b *.txt') do (
set N=0
for /f "tokens=* delims= " %%i in (%%a) do (
set /a N+=1
if !N! equ !X! echo %%i
)
)


=====================================
Helping others achieve escape felicity

M2


Report •

#2
March 9, 2010 at 07:19:17
Thanks for your help! I will let you know if I need any further help

Report •
Related Solutions


Ask Question