I am trying to insert the filename (minus the extension) in front of every line in a series of TXT files. I have put together code to make the change in a single txt file, but am lost as how to get it to perform the action on all TXT files in the folder.
Here is an example of what the TXT files contain:
(There can be more lines after this, but they will follow the same 7 line format.)
Here is an example of what I want the TXT files to look like after:
Here is the code I have created so far:
@echo off > newfile & setLocal EnableDelayedExpansion
for /f "tokens=* delims=" %%a in (Graphic1000.txt) do (
echo filename_%%a >> Graphic1000a.txt)
I have only put 'filename_' as a placeholder since I don't know how to get the filename the batch file is currently processing.