You are here: PSPad forum > English discussion forum > another regex error

another regex error

#1 another regex error

Posted by: kenking | Date: 2019-04-30 15:27 | IP: IP Logged

I am extracting text from an Excel file, then in PSPAD, I need to replace, using regular expressions, the tab character(\t) with the newline (\n) character. With past versions of PSPAD this has not been a problem. Since I have installed the latest version this function has not preformed correctly. When there a multiple tab characters only a few get replaced and I have to do additional Replace functions until all have been replaced. When I have hundreds this is quite frustrating.

Am I missing something or is this indeed an bug?

How can I get around this?

Options: Reply | Quote | Up ^


#2 Re: another regex error

Posted by: vbr | Date: 2019-04-30 18:08 | IP: IP Logged

kenking:
I am extracting text from an Excel file, then in PSPAD, I need to replace, using regular expressions, the tab character(\t) with the newline (\n) character. With past versions of PSPAD this has not been a problem. Since I have installed the latest version this function has not preformed correctly. When there a multiple tab characters only a few get replaced and I have to do additional Replace functions until all have been replaced. When I have hundreds this is quite frustrating.

Am I missing something or is this indeed an bug?

How can I get around this?

Hi, for replacing with \n in PSPad a workaround is needed: place the caret/cursor at the end of the text and in the replace dialog, set the search direction to (o) Backwards

and perform the replacement from the end to the beginning of the text.

hth,
vbr

Options: Reply | Quote | Up ^


#3 Re: another regex error

Posted by: Andreas | Date: 2019-04-30 21:07 | IP: IP Logged

Maybe you have luck with the backward trick but I do not remember that replacing with newline ever worked.

Try to use the "Multiline Search / Replace" script also called phreplace by www.phdesign.com.au. You will find installation help here in the forum.

With this tool you can simply enter a newline with the keyboard or a tab with shift+tab - \n and \t are not needed with this script.

Options: Reply | Quote | Up ^


#4 Re: another regex error

Posted by: kenking | Date: 2019-05-02 18:18 | IP: IP Logged

thanks vbr

your suggestion worked fine

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