need to delete 50 linefeeds in a row..

A place to try and solve your RegEx problems.
Post Reply
amster
Posts: 4
Joined: Wed Apr 29, 2015 8:03 pm

need to delete 50 linefeeds in a row..

Post by amster »

I have text output... and then its separated by 50 line feeds or carriage returns.... (not sure which or if there is a difference!) and then there's more text... and then 50 line feeds again.....


Please can someone help me accomplish this?

Thanks in advance.
User avatar
DigitalVolcano
Site Admin
Posts: 1717
Joined: Thu Jun 09, 2011 10:04 am

Re: need to delete 50 linefeeds in a row..

Post by DigitalVolcano »

There's a Regular Expression in the TextCrawler library called 'Find/Strip Whitespace' - this may do the job (back up first though)!
amster
Posts: 4
Joined: Wed Apr 29, 2015 8:03 pm

Re: need to delete 50 linefeeds in a row..

Post by amster »

Hi there. Thanks for the response. Yes I have seen that feature.

But I do not want to get rid of the rest of the whitespace... I want to just find the sections where I have big breaks of like 20, 30, 40, 50 lines of linefeed.

Please help!
User avatar
DigitalVolcano
Site Admin
Posts: 1717
Joined: Thu Jun 09, 2011 10:04 am

Re: need to delete 50 linefeeds in a row..

Post by DigitalVolcano »

Try this:

RegEx

Code: Select all

(\r\n){20,}
Replace:

Code: Select all

\r\n
The 20 is the minimum number of blank lines (-1) before it is removed. This assumes CRLF line endings - you may have to change it to just \n for LF endings.
amster
Posts: 4
Joined: Wed Apr 29, 2015 8:03 pm

Re: need to delete 50 linefeeds in a row..

Post by amster »

Thanks
Post Reply