Hello Dos Guru's
I have a list in a txt file. i want to use each line as a different variable.
i do not mind using only the first line in the file than deleting that line thus the next loop will use the first line again?
i am trying to run a gpg script on only files with the gpg extension.
i ported the directory with a clean list of files to process into a filelist.txt using the :
dir *.gpg /b > filelist.txt
but i now can't figure out how to put these files into variables to use in my batch.
i want to run another batch file on each file...
also there will never be more than 9.
Thanks All!
How Can I use a list in a file as variables in a batch?
Moderator: DosItHelp
quantuml,
You might want to use a loop like this:
You could do the same without the intermediate filelist.txt:
DOS IT HELP?
You might want to use a loop like this:
Code: Select all
for /f "tokens=*" %%f in (filelist.txt) do (
echo.Now processing %%f
call OtherBatch.bat %%f
)
You could do the same without the intermediate filelist.txt:
Code: Select all
for %%f in (*.gpg) do call OtherBatch.bat %%f
DOS IT HELP?
It worked Great but now how can i use only the first one
Thanks
The syntax worked great
But now i want to use only the first file it finds.
i have to make it run every 15 minutes on each file it finds.
any suggestions?
Quantuml
The syntax worked great
But now i want to use only the first file it finds.
i have to make it run every 15 minutes on each file it finds.
any suggestions?
Quantuml
quantuml,
Do you want to run like this:
file 1, wait 15 minutes, file 2, wait 15 minutes, ..., file N, wait 15 minutes, file 1, wait 15 minutes, file 2, ...
or like this:
file 1, file 2, ..., file N, wait 15 minutes, file 1, file 2, ..., file N, wait 15 minutes, file 1, file 2, ..., file N, wait 15 minutes, ...
Do you want to run like this:
file 1, wait 15 minutes, file 2, wait 15 minutes, ..., file N, wait 15 minutes, file 1, wait 15 minutes, file 2, ...
or like this:
file 1, file 2, ..., file N, wait 15 minutes, file 1, file 2, ..., file N, wait 15 minutes, file 1, file 2, ..., file N, wait 15 minutes, ...
Well Lets See
More like
file 1.... (in my script i will delete the file that i just ran the batch on)...
so technically 15 min goes by and i do the same batch on the new file 1
my problem is that the file name changes every time and there might be multiple files that show up. but i do know the extension.
quantuml
file 1.... (in my script i will delete the file that i just ran the batch on)...
so technically 15 min goes by and i do the same batch on the new file 1
my problem is that the file name changes every time and there might be multiple files that show up. but i do know the extension.
quantuml
Ok here is what i need
Hey DosItHelp
Sorry for the deley i thought i had it working but i guess i need the gurus help.
ok i get a series of files everyday in a folder:
ussually formated like this
sdtrigger.todays_date.batchfilenumber.835.pgp
so i ussually only look for the {sdtrigger.*.*.835.pgp} becasue the date and the batch file are always different.
i also get files that are named like this:
SD_FAX.todaysdate.batchnumber.txt.pgp
i want to check to see if there is a file with the "sdtrigger" in the name. if there is i want to process that file.
The process is all setup to go. I would just pass that file name to process batch file.
sometimes there might be more than one file with "sdtrigger" in it. (this happens when there are multiple dates to send.)
also i can't process "sdtrigger" files back to back. i need to wait at least 15 min between processes.
Thanks for the thought.
Quantuml
Sorry for the deley i thought i had it working but i guess i need the gurus help.
ok i get a series of files everyday in a folder:
ussually formated like this
sdtrigger.todays_date.batchfilenumber.835.pgp
so i ussually only look for the {sdtrigger.*.*.835.pgp} becasue the date and the batch file are always different.
i also get files that are named like this:
SD_FAX.todaysdate.batchnumber.txt.pgp
i want to check to see if there is a file with the "sdtrigger" in the name. if there is i want to process that file.
The process is all setup to go. I would just pass that file name to process batch file.
sometimes there might be more than one file with "sdtrigger" in it. (this happens when there are multiple dates to send.)
also i can't process "sdtrigger" files back to back. i need to wait at least 15 min between processes.
Thanks for the thought.
Quantuml