Computing.Net > Forums > OpenVMS > To split a string with a space

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.

To split a string with a space

Reply to Message Icon

Name: Sharitha
Date: October 6, 2004 at 06:05:00 Pacific
OS: OpenVMS
CPU/Ram: DS20E
Comment:

Hi,
I have file in whish the record are stored as
30 95
40 89

i need to read this file line by line and split the String into 2 variables
eg: variable a =30
varibale b=95
Kindly help

Shari



Sponsored Link
Ads by Google

Response Number 1
Name: Hakan Andersson (by HakAnd)
Date: October 6, 2004 at 07:27:59 Pacific
Reply:

a = f$element(0," ",string)
b = f$element(1," ",string)


0

Response Number 2
Name: Bob Gezelter
Date: October 6, 2004 at 08:44:04 Pacific
Reply:

Shari,

Hakan has provided an example of how to split the records in DCL, the command language used on OpenVMS.

Taking a second look at your posting, it occurs to me that you did not mention the language you are using. If we know the language, the answer may be clearer.

- Bob Gezelter


0

Response Number 3
Name: Hakan Andersson (by HakAnd)
Date: October 6, 2004 at 09:20:57 Pacific
Reply:

As Bob mentioned, I took for granted that a DCL command was requested........


0

Response Number 4
Name: VMSFan
Date: October 7, 2004 at 14:30:52 Pacific
Reply:

It might also help to:

F$EDIT(string, "COMPRESS,TRIM")

before using F$ELEMENT (just in case there may be extra spaces).


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Creating a queue To read end of line -DCL



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to OpenVMS Forum Home


Sponsored links

Ads by Google


Results for: To split a string with a space

using the sed command? (error) www.computing.net/answers/openvms/using-the-sed-command-error/75.html

How to edit a binary file ? www.computing.net/answers/openvms/how-to-edit-a-binary-file-/191.html

Command Proc to Logout a Terminal S www.computing.net/answers/openvms/command-proc-to-logout-a-terminal-s/239.html