Batchfiles substring

March 26, 2009 at 16:44:48
Specs: Windows Vista
Unfortunatelly I am poorly new to batch-files. Ich hopfe you can help me.

In my directory, I have got some files with following name: "blabla(myIntrest).txt".
How can I extract "myIntrest" to a variable in a batch-file. It looks all so komplicated.


See More: Batchfiles substring

Report •

March 26, 2009 at 22:02:21
@echo off & setLocal EnableDelayedExpansion

set N=

for /f "tokens=* delims= " %%t in ('dir/b/a-d *.txt ^| find "("') do (
for /f "tokens=2 delims=()" %%a in ("%%t") do (
set /a N+=1
set var!N!=%%a

set v

If at first you don't succeed, you're about average.


Report •

March 27, 2009 at 03:32:43
what do you want to do after you extract the text? you want to rename the file ?

Report •

Related Solutions

Ask Question