return a string from a file

Microsoft Windows xp home edition sp2b
July 27, 2009 at 09:57:27
Specs: Windows XP
Hi,

I'm trying to automate a small batch file to find and return a specific string of characters within several folder within a sub folder...

here is my code so far

@echo off > collection.txt
for /f %%a in ('dir /ad /b /s') do (
for %%T in (%%a/_cards.dat) do (
find "id=" < %%T >> collection.txt))

the program is currently looking in the active folder in all subfolder then find all files named "_cards.dat" then find all line begining with "id=" and returning them... the result is a file named collection.txt that look more or less like the following:

id=1
id=2
id=3
id=4
etc...

So I would like to produce the same file but without having the "id=" in front of the id...

I try something like
set str=%%T
and
%str:~2%

but it does not want to work... So at the moment i use words to find and replace but it's pretty anoying since I need to produce this file quite offen

Any ideas ?


See More: return a string from a file

Report •


#1
July 27, 2009 at 10:00:01
"here is my code"

programming forum not xp forum


Report •

#2
July 27, 2009 at 10:08:31
thanks for the constructive help...

was misleaded because found this forum by making a search and found the following post:
http://www.computing.net/answers/wi...

that why I posted in "windows xp" (as the above mentioned post...


Report •

Related Solutions


Ask Question