I have a directory with over 100 text files.
How can I append the word "END" at the end of every file within that directory?
I have a directory with over 100 text files.
How can I append the word "END" at the end of every file within that directory?
PowerShell option:
"END" | Add-Content -path *.txt
Add-Content
will append the pipeline input to all files matching its parameters (there are other options to include/exclude lists of wildcard patterns).
Follow these steps.
for %f in (*.txt) do echo END >> %f
Note:
If your text file encoding is not ANSI
, then the result might be different from what you want.
ANSI > This is a test.END
Unicode > This is a test.久⁄
Unicode big endian > This is a test.䕎䐠ഊ
UTF-8 > This is a test.END
You might want to check these links too...