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

how to extract command fields??

Reply to Message Icon

Original Message
Name: wistler
Date: January 23, 2008 at 04:04:04 Pacific
Subject: how to extract command fields??
OS: a
CPU/Ram: a
Model/Manufacturer: 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


Report Offensive Message For Removal


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

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


Report Offensive Follow Up For Removal

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

Ooooops,....

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


Report Offensive Follow Up For Removal

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

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


Report Offensive Follow Up For Removal

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

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


Report Offensive Follow Up For Removal

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

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!)


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: how to extract command fields??

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge