ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: Paste Something To Bottom Of All Text Files, Recursively

(1/2) > >>

nkormanik:
Wondering if anyone knows of a present way, or perhaps it can be made.

I have a folder of text files, each in their own subfolders, and I want to place the following at the very bottom of each of the text files:

endsas;

Not necessary, but nice to put a blank line above, separating from rest of text.

Thanks much, folks.

Nicholas Kormanik

Ath:
Most likely you can fix that using (DC-member) stahlworks Swiss File Knife

4wd:
Put this in a DOS batch file and then at a prompt type: RecAppTxt.cmd <path>

Where <path> is the top level directory you want, eg. RecAppTxt.cmd D:\TXT_Files_Below_Here\Demo

Don't forget to put <path> in quotes if it has spaces.


--- Code: Text ---REM RecAppTxt.cmdfor /r %1 %%f in (*.txt) do (echo. >>%%f && echo "endsas;" >>%%f)
Try it on a test directory first, it worked here but who knows

nkormanik:
Thanks 4wd.  Excellent approach.

Ath, while Swiss File Knife does a lot, I don't think it can do what's being asked.  But thanks for your suggestion.

4wd:
You can also split it into a two line batch/command file, just in case the resultant echo command results in a really long command line, (long path/file names).

eg.


--- Code: Text ---for /r %1 %%f in (*.txt) do (echo. >>%%f)for /r %1 %%f in (*.txt) do (echo "endsas;" >>%%f)
It'll add the blank line on the first and the the "endsas;" on the second.

Navigation

[0] Message Index

[#] Next page

Go to full version