Find The Beginning & End of Text and Replace with BLANK?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
jmca2000
Posts: 15
Joined: Thu Feb 24, 2011 5:09 pm

Find The Beginning & End of Text and Replace with BLANK?

Post by jmca2000 »

Hi, Could someone Please Help me figure out how to change the following code?

Code: Select all

if (//abovePrice_292
                whiteLineAbovePrice_Y
				&& orangeLineAbovePrice_N
				&& yellowLineAbovePrice_N
				&& cyanLineAbovePrice_Y
				&& blackLineAbovePrice_N
				&& dodBlueLineAbovePrice_N
				&& blueLineAbovePrice_N
				&& greenLineAbovePrice_Y
				&& redLineAbovePrice_Y
			   )			
				{
				//abovePrice_292 = true ;
				DrawText("abovePrice_292" + DateTime.Now.Millisecond.ToString() + CurrentBar + DateTime.Now.Millisecond.ToString()
				+ CurrentBar + CurrentBar + DateTime.Now.Millisecond.ToString(), "A292", 0, Low[0]-(TickSize*13), Color.Black);
				Print("//abovePrice_292");
				Print("&& whiteLineAbovePrice_Y");
				Print("&& orangeLineAbovePrice_N");
				Print("&& yellowLineAbovePrice_N");
				Print("&& cyanLineAbovePrice_Y");
				Print("&& blackLineAbovePrice_N");
				Print("&& dodBlueLineAbovePrice_N");
				Print("&& blueLineAbovePrice_N");
				Print("&& greenLineAbovePrice_Y");
				Print("&& redLineAbovePrice_Y");
                }
TO:

Code: Select all

 if (//abovePrice_292
                whiteLineAbovePrice_Y
				&& orangeLineAbovePrice_N
				&& yellowLineAbovePrice_N
				&& cyanLineAbovePrice_Y
				&& blackLineAbovePrice_N
				&& dodBlueLineAbovePrice_N
				&& blueLineAbovePrice_N
				&& greenLineAbovePrice_Y
				&& redLineAbovePrice_Y
			   )			
				{
				//abovePrice_292 = true ;
				DrawText("abovePrice_292" + DateTime.Now.Millisecond.ToString() + CurrentBar + DateTime.Now.Millisecond.ToString()
				+ CurrentBar + CurrentBar + DateTime.Now.Millisecond.ToString(), "A292", 0, Low[0]-(TickSize*13), Color.Black);
				Print("//abovePrice_292");
				Print("&& whiteLineAbovePrice_Y");
				Print("&& cyanLineAbovePrice_Y");
				Print("&& greenLineAbovePrice_Y");
				Print("&& redLineAbovePrice_Y");
                }
I Just want to Delete the Lines that Start with Print and end with _N");

I have tried :

Find what: ^([ \t]*)(([Print]*)+[a-z]+)_N");
Replace with:

Thank You Very much in Advance!
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Search | Replace... (<F8>):
Find what: ^[ \t]*Print\(.+_N"\);\n
Replace with: [nothing]

[X] Regular expression

Replace All
jmca2000
Posts: 15
Joined: Thu Feb 24, 2011 5:09 pm

Post by jmca2000 »

THANKs Ben, Worked Like a Charm!!!
Post Reply