Page 1 of 1

Elimine one line in multline search

Posted: Tue May 05, 2009 1:59 pm
by ccmancio
I have following :

line1
line2
ConstA
ConstB

and I need :
line1
line2
ConstB

I try fisrt find ConstA\nConstB and not find... ;-)
I seek in forum but dont find ..

Posted: Tue May 05, 2009 2:53 pm
by ben_josephs
Did you select Regular expression?

Is there any white space at the end of the line ConstA or at the beginning of the line ConstB?

Posted: Tue May 05, 2009 3:28 pm
by ccmancio
yes, I set regular expression
Not spaces at end of line ConstA and begin of Line ConstB
but, right is Const A, Const B with space

Posted: Tue May 05, 2009 5:08 pm
by ben_josephs
So did you try searching for
Const A\nConst B
?

Posted: Tue May 05, 2009 5:33 pm
by ccmancio
yes.
I say this in initial topic.

This is a Visual Basic Code.
Transform Code A in Exit Sub and Code B in End Sub and you have my problem :

Private Sub..
...
Exit Sub
End Sub

Private Function
...
Exit Function
End Function

I want eliminate a Exit Sub/Function before End Sub/Function in old Visual Basic code (*.frm and *.bas)

Posted: Tue May 05, 2009 6:35 pm
by ben_josephs
No, you didn't.

I suspect I do not understand your requirements.

Does searching for
Exit Function\nEnd Function
and
Exit Sub\nEnd Sub
not work?

Posted: Tue May 05, 2009 8:25 pm
by ccmancio
yes.
I am using TextPad 4.7.3 (Not exist still brazilian version)

Find : Exit Sub\nEnd Sub
Files ; *.frm;*.bas
Folders : C:\My VBProjects

Conditions : Text and Regular Expression
Details : All lines
Search in subfolders

Result : Is not possible find files at regular expression include "\n"
(Não foi possivel pesquisar arquivos para encontrar uma expressão regular incluindo '\n')

I seach wich Posix and without Posix setting

Posted: Tue May 05, 2009 8:40 pm
by Bob Hansen
Trying to help define the problem.....
Do you have something like this, blocks of Sub/Function code that you need to remove the lines between the Exit and End lines?

Exit Sub
line 1
line 2
line 3
End Sub

Exit Function
line 1
line 2
line 3
line 4
End Function

ends up as

Exit Sub
End Sub

Exit Function
End Function
================================

Posted: Tue May 05, 2009 8:47 pm
by ben_josephs
You didn't say you were using Find In Files.

The error message means what it says. This is a deficiency of the Find In Files functionality in TextPad. Have you considered WildEdit (http://www.textpad.com/products/wildedit/), which is designed "to make the same changes to a set of text files in a folder hierarchy".

Posted: Wed May 06, 2009 11:41 am
by ccmancio
no, Bob Hansen

don't have block of statments betwen Exit Sub/End Sub
only have this statements, but Exit Sub is not necessary now (in VB3 is necessary) and in need remove.