View previous topic :: View next topic
|
Author |
Message |
shivakumar .b Warnings : 1 New User
Joined: 11 May 2005 Posts: 18 Location: bangalore
|
|
|
|
HELLO EVERYBODY,
THIS IS SHIVAKUMAR.
IN ONE OF MY INTERVIEW, I WAS ASKED THE FOLLOWING QUESTION.
-- SUPPOSE IF A PROGRAM CONTAINS SOME THOUSANDS OF LINES AND IF U WANT TO LOCATE A STRING TO SEE THAT IN WHICH R ALL THE LINES THAT STRING IS PRESENT. WHAT HE ASKS IS, SUPPOSE IF FIRST OCCURANCE OF STRING IS IN 10TH LINE AND SECOND OCCURENCE IS IN 2000TH LINE. THEN WITHOUT USING PAGE DOWN OPTION HOW CAN U IMMEDIATELY KNOW WHERE IS THE SECOND OCCURENCE?OR IS IT POSSIBLE TO DISPLAY ONLY THOSE LINES WHICH CONTAIN THAT STRING?
ANYBODY PLZ GET ME THE ANSWER.
THANKS IN ADVANCE. |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
I assume that you are working in TSO then I think that you can use an exclude command as:
X ALL
from the command line and then you can find your string with relative position in order of lines:
F 'mystring' ALL
you will receive all the line that contains your string.
If you need a precise order of row you must renum your program before the exclusion/find with commands: RENUM and UNNUM |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
Ehm.... but without complicate the problem I think that a Find and an PF5(that in much cases is set to rfind) will solve your request.
If PF5 does not work view your personal keys setting with command KEYS
and then substitute the function of command F5:
Code: |
K Key Definition Format Label
K F1 . . . HELP SHORT Help
K F2 . . . SPLIT LONG Split
K F3 . . . EXIT SHORT Exit
K F4 . . .
K F5 . . . RFIND SHORT Rfind |
|
|
Back to top |
|
|
shivakumar .b Warnings : 1 New User
Joined: 11 May 2005 Posts: 18 Location: bangalore
|
|
|
|
THANKS MGINDACO.
THANKS A LOT. |
|
Back to top |
|
|
joseph ladish
New User
Joined: 28 Mar 2006 Posts: 3
|
|
|
|
hi,
this will perform ur operation
type f followed by that sting then the first time this will display the first string then u have to press f5 key then this will locate the next occurence
plz try this
joseph |
|
Back to top |
|
|
rajesh_1183
Active User
Joined: 24 Nov 2005 Posts: 121 Location: Tadepalligudem
|
|
|
|
You just follow the MGINDACO solution.....
Code: |
CMD ===> X ALL;F ALL <your string> |
Thanks,
Rajesh |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
It's really your preference and perhaps the situation you find yourself in. The "x al"l solution makes it easier to compare the 2 stmts that you find the string in. For example:
-------------------------------------------------------------------------------------
000100 1ST OCCURANCE OF THE STRING
-------------------------------------------------------------------------------------
000950 2ND OCCURENCE OF THE STRING
-------------------------------------------------------------------------------------
You can easily notice that OCCURENCE is spelled differently in each line.
This might be harder to catch w/the PF5 approach. |
|
Back to top |
|
|
|