I have a bat file which is reading another txt file and send the values to the external exe file, which generates an output file with the out of these commands.
for /f "tokens=*" %%A in (data.txt) do (
:start
XYZ.exe %%A )
and the content of data.txt is like this:
abc 1 2
xyz 2 3
Now, i am editing the data.txt like this:
name of file: mp3
abc 1 2
xyz 2 3
name of file: mp4
sss 1 2
rrr 2 3
name of file: vob
eee 1 2
qqq 2 3
and i need to use the name of File to create a file with the extension name as mentioned every time to append in the last.
Edited:
I mainly need to find a way that i can save the value of name of file in a variable every time it comes. So, for example in the above text file, when i run the batch, it will see if name of the file exists or not. If it exists then it will save the value i.e. mp3 in above case and save it and then call the XYZ.exe until the name of file dont come again. As soon the new file name comes, a method will call which will merge the two outputs generated by the XYZ form the two parameters and merge them into a file and append the extension of that file with a mp3.
Then again the new file name will get saved in the same variable and the process continues.
If there is not a single instance of this file name in the data.txt, the extension will be txt for the resultant file. I think it should be clear now. Please let me know for more clarifications..
xyzprogram would accept an output file name we can't really help you here. And I had to read that question four times or so to get an idea of what you're trying.