Page 1 of 1

extracting directory name from list

Posted: 06 Aug 2008 17:23
by otepmong
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

Posted: 13 Aug 2008 11:00
by greenfinch
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?