Computing.Net > Forums > OpenVMS > how to extract command fields??

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to extract command fields??

Reply to Message Icon

Name: wistler
Date: January 23, 2008 at 04:04:04 Pacific
OS: a
CPU/Ram: a
Product: a
Comment:

hi,

i am new to this...i need to find a method to extract or display only certain fields

for eg: show network gives the fields like product, node and address....

how can i get only the address??

thx



Sponsored Link
Ads by Google

Response Number 1
Name: HakZan
Date: January 23, 2008 at 06:01:10 Pacific
Reply:

As noticed in my earlier reply, I'm using lexical functions to get the information needed.

A lexical function is no a command, it is a subprogram that you can use.

$ HELP LEXICALS

STR = "This is just a textstring"

I can look at the string "str" as a textstring or as a list of words separated by a space.

A = f$extract(8,4,str)

I extract 4 characters starting at character 8 from the string represented by the symbol "str".
A = "just"


or

A = f$element(2," ",str)

I get the second element in the list (str) with delimiter " ".

There are a lot of examples in the HELP-utility. Let the lexicals be your best friends.

regards,

Hakan Zanderau
HA-solutions


0

Response Number 2
Name: HakZan
Date: January 23, 2008 at 06:03:44 Pacific
Reply:

Ooooops,....

f$element starts at element 0.....
f$element(2," ",str) will extract the third word


0

Response Number 3
Name: wistler
Date: January 23, 2008 at 09:43:16 Pacific
Reply:

isint this complicated to extract fields from output which are all across the screen....is there a easier way to extract the fields like the cut or awk we use in unix


0

Response Number 4
Name: HakZan
Date: January 23, 2008 at 11:26:44 Pacific
Reply:

I'm not a frequent UNIX-user so I don't know how "awk" or "cut" work..........

Please explain more about your problem.

regards,

Hakan Zanderau
HA-solutions


0

Response Number 5
Name: SKStewart
Date: January 25, 2008 at 07:04:42 Pacific
Reply:

Gawk and Perl for OpenVMS are listed on the official freeware page. Go to www.hp.com/go/openvms and look for the "OpenVMS Resources column".

Hakan makes an important point about learning the lexical functions. In OpenVMS, parsing a command output for information is usually a last-ditch approach. I always look for logical name or a lexical function that gives the information I want. (That said, I haven't found a good one for DECnet address!)


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon





Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: how to extract command fields??

How to use tcpdump ? www.computing.net/answers/openvms/how-to-use-tcpdump-/545.html

How to block ip-address ? www.computing.net/answers/openvms/how-to-block-ipaddress-/527.html

How to recieve arguments from user www.computing.net/answers/openvms/how-to-recieve-arguments-from-user/596.html