Find the TEXT1 and put the TEXT2 to the next line

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
Siaruzb
Posts: 20
Joined: Thu Jul 27, 2006 6:02 pm

Find the TEXT1 and put the TEXT2 to the next line

Post by Siaruzb »

Hi Guys,

I have the following syntaxex to run about 100 tables:

VARIABLE LABELS Q16 ''.
TABLES FORMAT=ZERO TFSPACE(0) SPACE NFRAME NBOX TTSPACE(1) PTSPACE(0)
/PFOOTNOTE=LEFT ".newpage"
/TABLE=T+A1+A2+A3+A4+A5+A6+A7+A8+A9 BY T2+Q16
/STAT=COUNT(T2(PAREN6)' ') CPCT(Q16(PCT3)' ':
PRINT TABLES DEVICE=OTHER/OUTPUT=TAB16.

VARIABLE LABELS Q17 ''.
TABLES FORMAT=ZERO TFSPACE(0) SPACE NFRAME NBOX TTSPACE(1) PTSPACE(0)
/PFOOTNOTE=LEFT ".newpage"
/TABLE=T+A1+A2+A3+A4+A5+A6+A7+A8+A9 BY T2+Q17
/STAT=COUNT(T2(PAREN6)' ') CPCT(Q17(PCT3)' ':
PRINT TABLES DEVICE=OTHER/OUTPUT=TAB17.

So I have to find this text:
/PFOOTNOTE=LEFT ".newpage"

Then have to put this text to the next line:
/SORT A1

Thank you.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Explaining what to Find is good.

Not clear what you want to end up with, Please show sample of final lines when done with sample lines above.
Hope this was helpful.............good luck,
Bob
Siaruzb
Posts: 20
Joined: Thu Jul 27, 2006 6:02 pm

Post by Siaruzb »

Sorry, I have to add a new line with following text: /SORT A1

So final tables should be like this:

VARIABLE LABELS Q16 ''.
TABLES FORMAT=ZERO TFSPACE(0) SPACE NFRAME NBOX TTSPACE(1) PTSPACE(0)
/PFOOTNOTE=LEFT ".newpage"
/SORT A1
/TABLE=T+A1+A2+A3+A4+A5+A6+A7+A8+A9 BY T2+Q16
/STAT=COUNT(T2(PAREN6)' ') CPCT(Q16(PCT3)' ':
PRINT TABLES DEVICE=OTHER/OUTPUT=TAB16.

VARIABLE LABELS Q17 ''.
TABLES FORMAT=ZERO TFSPACE(0) SPACE NFRAME NBOX TTSPACE(1) PTSPACE(0)
/PFOOTNOTE=LEFT ".newpage"
/SORT A1
/TABLE=T+A1+A2+A3+A4+A5+A6+A7+A8+A9 BY T2+Q17
/STAT=COUNT(T2(PAREN6)' ') CPCT(Q17(PCT3)' ':
PRINT TABLES DEVICE=OTHER/OUTPUT=TAB17.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Try this ..... untested!

Search for: /PFOOTNOTE=LEFT ".newpage"\n
Replace with: /PFOOTNOTE=LEFT ".newpage"\n/SORT A1\n

Checkmark in box for Regular Expressions
Checkmark in box for POSIX syntax (Configure/Preferences/Editor)
Hope this was helpful.............good luck,
Bob
Siaruzb
Posts: 20
Joined: Thu Jul 27, 2006 6:02 pm

Post by Siaruzb »

Great! It works perfectly.

Thank you very much Bob.
Post Reply