Finding top and end of files

General questions about using TextPad

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

Post Reply
Chris

Finding top and end of files

Post by Chris »

Is there a regular expression to match the start and end of a file?
I'd like to wrap some html round a whole bunch of text files (find the start, replace with <head> etc., etc., ). This must be such a common situation - sure it could be done using Perl to loop through each file line by line but multifile search and replace in textpad would b eso muxch more convenient!
Ed

Re: Finding top and end of files

Post by Ed »

Not exactly but...
Replace all
\n
with
¬
(assuming ¬ is used nowhere)
(now go and have a lunch break as it takes ages)
Replace all
^.*$
with
<head> & <tail>
(or whatever) - now at this point some of the files caused an error "recursion too deep, stack overflowed" - but still ended up with the right answer!
Replace all
¬
with
\n

Good luck!
Post Reply