You are here: PSPad forum > English discussion forum > remove eol in search and replace

remove eol in search and replace

#1 remove eol in search and replace

Posted by: idefix2 | Date: 2019-01-25 20:37 | IP: IP Logged

Is there a way to remove linefeeds in search and replace

I have a file that looks like this (about 400 lines of that kind):

...
(Code:'KUN_FIBU'; Typ:'S'; Laenge: 10; Format:'';
Belegvar: true; MhngVar: true),
(Code:'KUN_KREDIT'; Typ:'R'; Laenge: 0; Format:'###.###.###,##';
Belegvar: true; MhngVar: true),

(Code:'LIE_NR'; Typ:'S'; Laenge: 10; Format:'';
Belegvar: true; MhngVar: false),
(Code:'LIE_KUNNR'; Typ:'S'; Laenge: 12; Format:'';
Belegvar: true; MhngVar: false),
...

and I would like to replace the linefeed before "Belegvar" by a single space.
Is there a way to do this, so that afterward the file looks like:

...
(Code:'KUN_FIBU'; Typ:'S'; Laenge: 10; Format:''; Belegvar: true; MhngVar: true),
(Code:'KUN_KREDIT'; Typ:'R'; Laenge: 0; Format:'###.###.###,##'; Belegvar: true; MhngVar: true),

(Code:'LIE_NR'; Typ:'S'; Laenge: 10; Format:''; Belegvar: true; MhngVar: false),
(Code:'LIE_KUNNR'; Typ:'S'; Laenge: 12; Format:''; Belegvar: true; MhngVar: false),
...

Sadly, Regex does not seem to search over linebreaks.

Options: Reply | Quote | Up ^


#2 Re: remove eol in search and replace

Posted by: pspad | Date: 2019-01-26 07:29 | IP: IP Logged

You can use alternative RegExp search script - PhReplace, RegReplace from here:
www.pspad.com

As alternative you can switch view to Hex mode and search EOL + string and replace with string and then switch back (Menu View / Hex)

Options: Reply | Quote | Up ^






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