extracting directory name from list

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
otepmong
Posts: 1
Joined: 06 Aug 2008 17:11

extracting directory name from list

#1 Post by otepmong » 06 Aug 2008 17:23

I am trying to extract the directory name out of the file list, I have. Here is an example code I have so far... How can I extract directory path out of each %%P

set filelist=.\anc_extraction_fifo11x512_fast_behavioral.bat .\anc_extract_divi\anc-out-y_in.txt
for %%P in (%filelist%) do (
echo %%P
for /f "tokens=1,2,3 delims=\ " %%a in (%%P) do set dir1=%%a&set dir2=%%b&set dir3=%%c
echo.dir1 "%dir1%"
echo.dir2 "%dir2%"
echo.dir3 "%dir3%"
)

output-------------------------------------

.\anc_extraction_fifo11x512_behavioral.bat
dir1 ""
dir2 ""
dir3 ""
.\anc_extract_divi\anc-out-y_in.txt
dir1 ""
dir2 ""
dir3 ""

--------------------------------------------
Any help would greatly be appriciate it.

Thanks,

Oh

greenfinch
Posts: 36
Joined: 17 Jul 2008 07:37

#2 Post by greenfinch » 13 Aug 2008 11:00

Hi Oh,

I'm not sure what you are aiming to get from this first line:

Code: Select all

set filelist=.\anc_extraction_fifo11x512_fast_behavioral.bat .\anc_extract_divi\anc-out-y_in.txt 


Is .\anc_extraction_fifo11x512_fast_behavioral.bat supposed to do something to .\anc_extract_divi\anc-out-y_in.txt to generate a filelist?

If not, are you trying to get the paths of those two files?

Post Reply