New and need help

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
trimguy
Posts: 2
Joined: Fri Sep 10, 2010 6:12 am

New and need help

Post by trimguy »

I am using the "find" command to find all instances of blocks of text that contain "Label=M" as follows:

[POLYGON]
Type=0x6
Label=M
Data0=(50.43214,-120.97473),(50.42825,-120.97703),(50.42956,-120.98306),(50.43357,-120.98068)
[END]

What should the find string look like to make this happen? I actually want to delete those blocks and the blank line after [END] in each instance.

(pulling my hair out)
Thanks
User avatar
Mike Olds
Posts: 226
Joined: Wed Sep 30, 2009 3:27 pm
Contact:

Post by Mike Olds »

Try:

>Search>Replace

Find:
Label=M \n

Replace:
{empty}

Replace All

Regular Expression on
Thank you, and
Best Wishes,
Obo
http://buddhadust.net/
check out the What's New? Oblog:
http://buddhadust.net/dhammatalk/dhamma ... ts.new.htm
trimguy
Posts: 2
Joined: Fri Sep 10, 2010 6:12 am

Post by trimguy »

I had tried that and I get a message: Cannot find regular expression 'Label=M\n'

Just to make sure we are on the same page, I have many blocks of text in my file that look like this:

[POLYGON]
Type=0x6
Label=M
Data0=(50.43214,-120.97473),(50.42825,-120.97703),(50.42956,-120.98306),(50.43357,-120.98068)
[END]

The only thing that changes from block to block is some will have Label=P which I want to keep and the values for Data=0 will change from block to block. Anyway, with all blocks that contain Label=M, I want to delete them starting from [POLYGON] to [END] and delete the one blank line after [END].

Thanks so much for your help.
User avatar
Mike Olds
Posts: 226
Joined: Wed Sep 30, 2009 3:27 pm
Contact:

Post by Mike Olds »

Label=M\n

Label=M \n

Note space on my example. When I copied and pasted your example and selected to the beginning of the following line there is a space before the newline.
Thank you, and
Best Wishes,
Obo
http://buddhadust.net/
check out the What's New? Oblog:
http://buddhadust.net/dhammatalk/dhamma ... ts.new.htm
Post Reply