textpad: inserting a word every # of lines

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
tonym
Posts: 3
Joined: Mon Dec 07, 2009 11:45 pm

textpad: inserting a word every # of lines

Post by tonym »

Hi,
Searched but could not locate this answer.
How can I insert a word every 15 lines in a file?

For example:
line 1
line 2
(..and so on)
line 14
line 15
>insert "word" here<
line 17
line 18
line 19

Thank you
Tony
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Search for: ^.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n
Replace with: \0new word\n

Replace All will not work, but Replace Next does work.

Use the following settings:
-----------------------------------------
[X] Regular expression
Replace Next
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Hope this was helpful.............good luck,
Bob
tonym
Posts: 3
Joined: Mon Dec 07, 2009 11:45 pm

Post by tonym »

Thank you Bob! I do appreciate the input and the quick response.
Cheers!
Tony
Post Reply