Go To End Of Files, Delete Blanks ONLY after last Character

General questions about using WildEdit

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

Post Reply
SoloStyl
Posts: 3
Joined: Mon Jul 02, 2007 9:37 pm

Go To End Of Files, Delete Blanks ONLY after last Character

Post by SoloStyl »

1000+ files and cant figure it out :(

I need to open all files (including Sub Directories) with extensions like :
*.123 *.abc *.qwerty

In each file, (in the last lines), delete ALL Blank spaces and Carriage Returns ONLY AFTER the last character.

EX: etc etc text text
also text any text <-- last charcter
[Carriage return]
[Carriage return]
[blank line]
[Carriage return]

What i need EX :
EX: etc etc text text
also text any text <-- last charcter

I hope I explained it correctly, If not please post, I'll try to be more specific.

Thanks In Advance, :)
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

There isn't anything in a file after its last character. That's what makes it the last character.

Do you mean you want to delete eveything after the last character that isn't white space?

Does this do what you want?
Find what: \s+\z
Replace with: [nothing]

[X] Regular expression
But that will leave the last line unterminated. To put the terminating newline back in, use
Find what: \s+\z
Replace with: \n
SoloStyl
Posts: 3
Joined: Mon Jul 02, 2007 9:37 pm

Post by SoloStyl »

WOW! Thanks for the Quickest reply I've ever seen in any forum :)

I'm gonna test what you've posted.

Wish me luck. lol
SoloStyl
Posts: 3
Joined: Mon Jul 02, 2007 9:37 pm

Post by SoloStyl »

Hrm,

The 1st "Quote" works fine, deletes everything after last character.

The 2nd "Quote" doesnt, it actually ADDS "\n" to the last character.

EX : last char in text\n <-- adds \n to last char

Regular Expresion = Checked

SHould I check in Options " Use POSIX" (maybe not) not sure what all those options mean. Thanks
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Use
[X] Replacement format
Post Reply