Help needed with using resuts from another command
Posted: 28 Aug 2008 05:36
Hi all,
New here so go easy on me..
I am writing a batch file to automate some cumbersome commands. The long and short of what i am tring to do is that i can get a command to run and it puts its out put into a tmp file, i then echo the results.
echo | capExtract c:\capextract %filename% > tmpcapextract$$.$$$
find "Found channel " < tmpcapextract$$.$$$
find "Found module " < tmpcapextract$$.$$$
del tmpcapextract$$.$$$
it gives the following output:
Found channel 6
Found module 1
Now what i would like to do is to use the numbers in the output as they will vary depending on what file a choose to use, but i would like to use them in my batch job later.
For example now that the file was checked and it returned with channel 6 and module 1. I now want to run another command capExtract c:\capextract %filename% ref %ChannelID% %moduleID%
digit 6 would need to be in %ChannelID%
digit 1 would need to be in %moduleID%
I hope this makes sense. Any help greatly received.
New here so go easy on me..
I am writing a batch file to automate some cumbersome commands. The long and short of what i am tring to do is that i can get a command to run and it puts its out put into a tmp file, i then echo the results.
echo | capExtract c:\capextract %filename% > tmpcapextract$$.$$$
find "Found channel " < tmpcapextract$$.$$$
find "Found module " < tmpcapextract$$.$$$
del tmpcapextract$$.$$$
it gives the following output:
Found channel 6
Found module 1
Now what i would like to do is to use the numbers in the output as they will vary depending on what file a choose to use, but i would like to use them in my batch job later.
For example now that the file was checked and it returned with channel 6 and module 1. I now want to run another command capExtract c:\capextract %filename% ref %ChannelID% %moduleID%
digit 6 would need to be in %ChannelID%
digit 1 would need to be in %moduleID%
I hope this makes sense. Any help greatly received.