Page 1 of 1

Delete entire rows

Posted: Mon Mar 02, 2015 8:09 am
by Torsten
Hello,
at first, sorry for my bad english. But I try it anyway. I want to search for a word and delete the entire row in which it occurs. So far I have used it with another program and used this command: " ^.*,XX.*\R " (XX indicates that searching word). But this does not work with TextCrawler because "\R" is not recognized. Is there another way?

Thank you in advance, Torsten

Re: Delete entire rows

Posted: Mon Mar 02, 2015 11:05 am
by DigitalVolcano
This works (lower case r):

Code: Select all

^.*,XX.*\r
You need the 'multi line anchors' option checked as well.

Re: Delete entire rows

Posted: Mon Mar 02, 2015 11:39 am
by Torsten
Ok, thank you for the quick reply, I will try it.

Torsten

Re: Delete entire rows

Posted: Mon Mar 02, 2015 9:27 pm
by Torsten
In regular expression tester it works very well. "^.*,XX.*\r\n" brings the correct result (,XX indicates that searching word). But not in the main window. Here is the message: No matches found. In both cases, I have the same settings. Is this a bug or what could I have done wrong?

Torsten

Re: Delete entire rows

Posted: Tue Mar 03, 2015 12:32 pm
by DigitalVolcano
Does your file not have CR/LF line endings? That could cause no matches with that expression. You can swap the \r\n for $ to indicate any line ending - then it will work on all files.
Also make sure that 'Multi line anchors' is checked.

Re: Delete entire rows

Posted: Tue Mar 03, 2015 6:00 pm
by Torsten
Here are three lines as an example:

S50ARX,S5,EU,3525.5,80m,PA4N,PA,EU,CQ,30,2012-08-25 00:00:00,25,CW
G0PZA,G,EU,3525.5,80m,PA4N,PA,EU,CQ,16,2012-08-25 00:00:01,25,BPSK
VE2WU,VE,NA,14019.3,20m,YO2BBX,YO,EU,CQ,25,2012-08-25 00:00:01,19,CW

Each line with ",CW" should be deleted. With "$" does not work. The lines are indeed empty, but still present. The line must be properly deleted, including any spaces.
Thanks for the help.

Torsten

Re: Delete entire rows

Posted: Tue Mar 03, 2015 9:15 pm
by Torsten
I've got it. With "^.*,CW.*\n" it worked. How can I delete the last empty line?

Torsten

Re: Delete entire rows

Posted: Tue Mar 10, 2015 10:34 am
by DigitalVolcano
(\n|$) maybe? That will match end of line or end of file.