Hi,
Actually got 2 enhancement I am looking for in Textpad.
1. Having a panel to shows/list out the functions inside a file. Sometimes there are so many lines that it is very difficult for me to find immediately a particular function inside a file.
2. Having a function to add text to the beginning/end/middle of every line.
Regards,
Tang
Panel To Shows Function Name, Add text on every line
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
1. has been discussed a few times already...
2. Adding text to beginning/end of a line is a simple RegEx replacement:
Beginning:
Replace (with RegEx switched on)
^
by
AddedText
End:
Replace (with RegEx switched on)
$
by
Added Text
Middle of the line is more difficult, esp. if the lines have different lengths.
If you want to add text at a certain column (lets say 17), use
Replace (with RegEx switched on)
^(.{17})
by
\1Added Text
Or if you want to add your text a certain number of columns before the end of line (lets say 42)
Replace (with RegEx switched on)
(.{42})$
by
Added Text\1
If the lines have different lengths, there is no Textpad method known to me. Esp. as there is the trouble of defining the middle. With a line containing an even number of characters, it is no problem, but when there is an odd number, should text be added before or after the character in the middle?
I think that in this case, Regexes are out of the game, this needs more logic ==> a script of some sort...
2. Adding text to beginning/end of a line is a simple RegEx replacement:
Beginning:
Replace (with RegEx switched on)
^
by
AddedText
End:
Replace (with RegEx switched on)
$
by
Added Text
Middle of the line is more difficult, esp. if the lines have different lengths.
If you want to add text at a certain column (lets say 17), use
Replace (with RegEx switched on)
^(.{17})
by
\1Added Text
Or if you want to add your text a certain number of columns before the end of line (lets say 42)
Replace (with RegEx switched on)
(.{42})$
by
Added Text\1
If the lines have different lengths, there is no Textpad method known to me. Esp. as there is the trouble of defining the middle. With a line containing an even number of characters, it is no problem, but when there is an odd number, should text be added before or after the character in the middle?
I think that in this case, Regexes are out of the game, this needs more logic ==> a script of some sort...
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
Then I open up and see
the person fumbling here is me
a different way to be
the person fumbling here is me
a different way to be
MudGuard wrote:1. has been discussed a few times already...
2. Adding text to beginning/end of a line is a simple RegEx replacement:
Beginning:
Replace (with RegEx switched on)
^
by
AddedText
End:
Replace (with RegEx switched on)
$
by
Added Text
Middle of the line is more difficult, esp. if the lines have different lengths.
If you want to add text at a certain column (lets say 17), use
Replace (with RegEx switched on)
^(.{17})
by
\1Added Text
Or if you want to add your text a certain number of columns before the end of line (lets say 42)
Replace (with RegEx switched on)
(.{42})$
by
Added Text\1
If the lines have different lengths, there is no Textpad method known to me. Esp. as there is the trouble of defining the middle. With a line containing an even number of characters, it is no problem, but when there is an odd number, should text be added before or after the character in the middle?
I think that in this case, Regexes are out of the game, this needs more logic ==> a script of some sort...
Hi MudGuard,
Thanks for your reply... it has been very helpful.
By the way, as there are a few discussion on the functions panel, is there going to be an add-on? or is this feature going to be integrated into the next version of textpad?
Regards,
Tang