View previous topic :: View next topic |
Author |
Message |
Pknair Beginner
Joined: 29 Nov 2005 Posts: 26 Topics: 9
|
Posted: Thu Dec 20, 2007 12:52 am Post subject: LINE_BEFORE command for the BOTTOM OF DATA line |
|
|
Need some help with an EDIT MACRO
The requirement is that I need to write multiple lines before the "BOTTOM OF DATA" line using an EDIT MACRO. I got it working with the LINE_AFTER command but I lost the sequencing. I understnd I can reverse the order of the sequence and do the LINE_AFTER but in this case the 7 lines have to be read in order as the lines below the first contain a variable which comes from the lines above.
The 3 lines in the dataset are given below
Code: |
000001 A=XXXX
000002 BA=Y$$$$$
000003 CABA=END
********BOTTOM OF DATA **************
|
Thank you for your help in advance
The following should be my output after the edit macro runs
Code: |
000001 A=XXXX
000002 BA=Y$$$$$
=NOTE= BXXXX=Y$$$$$
000003 CABA=END
=NOTE= CABXXXX=END
=NOTE= CAY$$$$$=END
=NOTE= CXXXXY$$$$$=END
********BOTTOM OF DATA********* |
|
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu Dec 20, 2007 9:17 am Post subject: |
|
|
The only solution I know is to add a temp line after .zl and then remove it. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Dec 20, 2007 1:52 pm Post subject: |
|
|
semigeezer that and 'LABELing' it, so you can find it again. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu Dec 20, 2007 3:17 pm Post subject: |
|
|
The label of the temp line will automatically be set to .zl (.ZLAST) so it can be deleted with a del all .zl .zl nx command or similar _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Fri Dec 21, 2007 3:46 am Post subject: |
|
|
Are the inserted mines always the same, or do they vary ? If they are always the same, then set them up as a member in the library that you are editing and try something like ...... but you will need to change the target location.
"ISREDIT COPY member BEFORE 1"
Another thought - if you know the value of the last line, can you increment / decrement this target value as you add each new line to put the output in the right place. |
|
Back to top |
|
|
moyeenkhan Beginner
Joined: 04 Dec 2002 Posts: 64 Topics: 21
|
Posted: Sun Feb 03, 2008 11:32 am Post subject: |
|
|
Read the first three lines
Build the next 4 lines
Do I=1 by 1 Until I=4
xData.I=Yoour Data
End
Insert the 4 lines in the reverse order
Do I=4 By 1 Until I=1
xData=xdata.I
Address ISREDIT 'Line_after (.zLast) = (xData)'
End |
|
Back to top |
|
|
moyeenkhan Beginner
Joined: 04 Dec 2002 Posts: 64 Topics: 21
|
Posted: Sun Feb 03, 2008 11:37 am Post subject: |
|
|
Oops
the last lines should read
Address ISREDIT 'Line_before (.zLast) = (xData)'
End/Exit |
|
Back to top |
|
|
|
|