Discussion:
Increments from content of a file
(too old to reply)
Bart
2011-07-18 22:13:03 UTC
Permalink
I have a file call node.out. The content of node.out may contain
multiple node names which are format by 1 line per column.

For example:

node1
node2
node3

I would like to take the each node names from node.out and set it to a
variable. Each node name will have an incremented variable name.

set VAR1=node1
set VAR2=node2
set VAR3=node3

I won't know how many node names my file node.out may contain so I
guess it needs to increment until the end of the file.

Thanks in Advance!
Richard Bonner
2011-07-22 14:46:38 UTC
Permalink
Post by Bart
I have a file call node.out. The content of node.out may contain
multiple node names which are format by 1 line per column.
node1
node2
node3
I would like to take the each node names from node.out and set it to a
variable. Each node name will have an incremented variable name.
set VAR1=node1
set VAR2=node2
set VAR3=node3
I won't know how many node names my file node.out may contain so I
guess it needs to increment until the end of the file.
*** This is probably not what you want, but since there have been no
other followups, I thought I'd throw this out there:

If your operation can be done via a DOS batch file, I would use XSET to
place each line into a variable. Also, 4DOS' `@LINE' function or `FOR'
command should also work -- and with fewer lines of code than XSET.
--
Richard Bonner
http://www.chebucto.ca/~ak621/DOS/
Loading...