extracting directory name from list
Posted: 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
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