View previous topic :: View next topic
|
Author |
Message |
Ambili S
Active User
Joined: 06 Sep 2007 Posts: 112 Location: India
|
|
|
|
Can we give more than 1 condition in the X ALL command . For e.g. X ALL 'hello' 8 80 and 'display' 50 60. Wherever hello appears in column 8 to 80 and display in colm 50 to 60 should get excluded . Can this be done in VIEW mode with X ALL command ? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Why not just do 4 commands?
Code: |
x all
f 'hello' 8 80 all
f 'display' 50 60 all
flip |
|
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Removed by poster. |
|
Back to top |
|
|
Ambili S
Active User
Joined: 06 Sep 2007 Posts: 112 Location: India
|
|
|
|
Hi Robert
I tried using the 4 commands , but it doesn't seem to give the desired result.
If hello appears between 8 to 80 and there's no display from 50 to 60 , then i want it in my output. With the above commands this record is geting excluded . |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
Then omit the flip command. |
|
Back to top |
|
|
Ambili S
Active User
Joined: 06 Sep 2007 Posts: 112 Location: India
|
|
|
|
What i want to know is , can we give more than one condition in an X ALL command. Going by the above criteria , if hello appears in 8 to 80 and there's no display in 50 to 60 , then that record should be present , similarly vice-versa. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I think you need to write an editor macro that examines each of your lines and determines whether to include or exclude. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
reset
x all 'hello' 8 80
f all 'display' 50 60
flip |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Code: |
1. hello
2. display
3. hello display
|
He wants 1 and 2, but not 3. |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
Try
Code: |
X ALL
F C'DISPLAY' 50 60 ALL
C C'HELLO' '!@#$%' 8 80 ALL NX
X ALL
F '!@#$%' 8 80 ALL
C '!@#$%' C'HELLO' ALL NX
FLIP |
Note: code the text strings (inside the quotes) EXACTLY as they will appear in the data being edited (i.e. all UPPERCASE (as shown), all lowercase, or exact CaMeL-CaSe; if the strings are not consistent throughout the data (upper/lower/camel-case), then the code above cannot be made to work properly). |
|
Back to top |
|
|
Ambili S
Active User
Joined: 06 Sep 2007 Posts: 112 Location: India
|
|
|
|
Thanks Ronald..It did work |
|
Back to top |
|
|
|