[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] Multiple changes to multiple files

In message <82af4b1653.iyojohn@xxxxxxxxxxxxxxxxxxxxx>
          John Rickman Iyonix <rickman@xxxxxxxxxxxxx> wrote:

> I would like to apply the same set of changes to a directory of about
> 50 files.
> The changes are:
> 1. Wrap a pair of <h1> tags around the first line of the file.
> 2. Insert some lines of text before the first line of the file
> 3. Wrap a pair of <h2> tags around all lines beginning with a #.
> 4. Add some lines of text to the end of the file.

I agree with Gavin that a script is probably the best way to go,
but I'll try to show how it could be done with StrongED.

> The files can all be loaded using ctrl drag-drop
> 1. and 3.   can be done using Search and Replace

3 yes, certainly. I'm not sure about 1, the first line would have to
distinct from all other lines in the same file as an S&R All will go
through entire files.

> I would appreciate some help on how to do 2. and 4.

Same as for 1 really, you need to have some way of matching the first
and last line and then perform a replace. If that's possible then it
can be done with StrongED.

If not, you might be able to use the OnLoad keyword to insert either the
required text directly, or insert a marker then use Search & Replace.

What you really need though is StrongED 4.69a8 :-)
It allows you to match against start/end of file ('<<<' and '>>>'), and
also against start/end of paragraph ('<<' and '>>').


StrongED Developer

To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx