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
extracting directory name from list
Moderator: DosItHelp
-
- Posts: 36
- Joined: 17 Jul 2008 07:37
Hi Oh,
I'm not sure what you are aiming to get from this first line:
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?
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?