How to make a paste across severl files all at once?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
marcus
Posts: 1
Joined: Thu Jul 17, 2003 7:21 am

How to make a paste across severl files all at once?

Post by marcus »

I love the feature inside the replace command to do the replace function across all open files. For example, I open 40 text files, and I want to go to the bottom of each text file and add the same line to each file. Preferably without a macro because I have to reprogram a new macro each time. Something like the replace function with "across all files" option is what I am looking for.

Currently, when I want to execute the same paste across 40 files, what I am doing now is doing a replace on the last characters of the last line, and replacing it with the same characters and then a regexp with "new line" and then add the line I want. It is quite a cumbersome workaround, and hoping somebody knows how I can do this easily?

Thanks,

Marcus
Ed
Posts: 103
Joined: Tue Mar 04, 2003 9:09 am
Location: Devon, UK

Post by Ed »

I don't think it's possible. (Now there's a challenge!)
A possible approach would be to write a macro that goes to the end of a file and appends a dummy string that is guaranteed not to occur in your file (eg "This string should not be here ~~##~~")
Cause the macro to operate on your 40 files (I don't know how to do that) maybe QuickMacros would be the answer.
Then do your search for your dummy string and replace with your required string.
The macro would then be reusable for any replacement.
Ed
Posts: 103
Joined: Tue Mar 04, 2003 9:09 am
Location: Devon, UK

Post by Ed »

I have a little program here that will append a given string to a list of files. This list can be obtained by Edit->Copy Other->All File Names. This will put all the currently open files into the list. The program is invoked as a command-line
add "Dummy string" filelist.txt

If you want it send me your address
Post Reply