You are here: PSPad forum > English discussion forum > delete five character of the end of line
Posted by: Esgrimidor | Date: 2017-03-07 11:05 | IP: IP Logged
I have a txt file with many lines ending in different character of lenght 5
I wish to delete the five characters in each line
How can I do that ?
Best Regards
--
Nice program indeed
Posted by: pspad | Date: 2017-03-07 11:25 | IP: IP Logged
Use regular expressions in Find/Replace dialog:
search: ^(.*).{5,5}$
replace: $1
[x]Regular expressions
$1 is substitution for first part in bracket
You search for anything of any length from the begin of line in the first part and last any chars from the end in the second part of expression
You will replace with the first part - line without last 5 chars
Posted by: Stefan | Date: 2017-03-07 11:35 | IP: IP Logged
FROM:
123456789012345
12345678
TO:
1234567890
123
USE e.g.:
Search: (.+).....$
Replace: $1
[x]Regular expressions
- - -
For Regular Expressions syntax see
gogogadgetscott.info
. any character in line
+ one or more
$ end of line
Subexpressions $1
.
.
--
Stefan (pleased user since 1722)
Do you know you can spend Jan a beer? (click here)
Inofficial FAQs + Infos + Special Settings
Posted by: Esgrimidor | Date: 2017-03-08 12:14 | IP: IP Logged
i will try and comment.
Best Regards
--
Nice program indeed
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR