Removing hidden periods after lines. Find/REPLACE

General questions about using TextPad

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

Post Reply
stevef22
Posts: 10
Joined: Mon Oct 10, 2005 8:14 pm

Removing hidden periods after lines. Find/REPLACE

Post by stevef22 »

How do I remove these hidden periods/spaces after my lines. Im using this text in a perl script and the hidden spaces are messing up my script.
Here is a picture of what Im talking about. Currently I am manually removing them.
Image
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

You could try Configure->Preferences->Document Classes->Default and tick "Strip trailing spaces from lines when saving" along with Configure->Preferences->Document Classes->Default->Tabulation, "Convert Existing Tabs to Spaces When Saving Files". Pls close all open documents first and make sure you're only running one instance of TP.
If that does not do it pls post the code from FIG1 using the code tag. HTH
Then I open up and see
the person fumbling here is me
a different way to be
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

If you don't want to use the strip trailing spaces on save variant, you could use

Code: Select all

 +$
for the search expression, nothing for the replace text.
Note the space (before the +)

If you also want to remove trailling tabs, use

Code: Select all

[ \t]+$
for the search expression, again nothing for the replace text.
Again, note the space (before the \)
stevef22
Posts: 10
Joined: Mon Oct 10, 2005 8:14 pm

Post by stevef22 »

Thanks guys, is there a sheet with the variables on it? Like \n for linebreak, etc etc?
stevef22
Posts: 10
Joined: Mon Oct 10, 2005 8:14 pm

Post by stevef22 »

Mudd, how did you figure out that? Are you a programmer for TextPad? What if we made a simple page with 2 frames. The left with the name of the outcome. ie (Remove Tabs) and in the right frame have the script. ? Is there allready a place for this?
Neat stuff. Find Replace is my friend.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Try the help: How To ... | Find and Replace Text | Use Regular Expressions and the following pages.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

stevef22 wrote:Mudd, how did you figure out that?
these simple regular expressions?
stevef22 wrote:Are you a programmer
yes
stevef22 wrote:for TextPad
no
stevef22 wrote:What if we made a simple page with 2 frames. The left with the name of the outcome. ie (Remove Tabs) and in the right frame have the script. ? Is there allready a place for this?
Neat stuff. Find Replace is my friend.
Frames? What has (bad) HTML got to do with it? And which script are you talking about?
stevef22
Posts: 10
Joined: Mon Oct 10, 2005 8:14 pm

Mudd, if your still here

Post by stevef22 »

Mudd, I was saying we should make a site with Textpad "Tricks" on it. U know... common functions everyday people try to perform but lack the knowledge. A left frame with a short discription, a right frame with the screen cap of the outcome.

Just an idea from a simple person.
User avatar
SteveH
Posts: 327
Joined: Thu Apr 03, 2003 11:37 am
Location: Edinburgh, Scotland
Contact:

Post by SteveH »

Try the help: How To ... | Find and Replace Text | Use Regular Expressions and the following pages.
There are another couple of good references available in addition to the help file. There is a Regular Expression Tutorial website that may be worth a look. O'Reilly have a Regular Expression Pocket Reference [ISBN 0-596-00415-X] that can be quite useful.

The most definitive reference of all is the O'Reilly book Mastering Regular Expressions by Jeffrey Friedl.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

The most definitive reference of all is the O'Reilly book Mastering Regular Expressions by Jeffrey Friedl.
Be sure to get the Second Edition.
Hope this was helpful.............good luck,
Bob
Post Reply