Loop and append different string to each file?
Posted: 25 Aug 2020 05:47
Hello,
I'd like your input on how to solve this problem.
I need to write a loop to 1) read all TXT files in a directory, and 2) insert a different string in each file.
Pseudo-code:
Can cmd do this, ideally for Windows 7/8/10?
Thank you.
I'd like your input on how to solve this problem.
I need to write a loop to 1) read all TXT files in a directory, and 2) insert a different string in each file.
Pseudo-code:
Code: Select all
for %%f in (*.TXT) DO (
ECHO Handling %%f
SELECT CASE
CASE 1.TXT:
echo "some text" >> %%f
CASE 2.TXT:
echo "some other text" >> %%f
CASE 3.TXT:
echo "yet some other text" >> %%f
)
Thank you.