Elimine one line in multline search

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
ccmancio
Posts: 11
Joined: Tue Jun 05, 2007 6:54 pm

Elimine one line in multline search

Post 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 ..
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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?
ccmancio
Posts: 11
Joined: Tue Jun 05, 2007 6:54 pm

Post 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
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

So did you try searching for
Const A\nConst B
?
ccmancio
Posts: 11
Joined: Tue Jun 05, 2007 6:54 pm

Post 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)
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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?
ccmancio
Posts: 11
Joined: Tue Jun 05, 2007 6:54 pm

Post 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
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post 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
================================
Hope this was helpful.............good luck,
Bob
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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".
ccmancio
Posts: 11
Joined: Tue Jun 05, 2007 6:54 pm

Post 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.
Post Reply