- May
- 13,748
- 209
I have a skeleton for something like:
which **uses @WORD** to set envvars to the various words in a string, with "*" skipping a word. It is of value? ... comments/suggestions? I'm not going to make it too complicated. Here are some examples.
(a somewhat practical one) the file ipv4.txt is a collection of lines like:
I could, for example,
Then I'd have
These two show that the end of the string is ignored and that unfilled variables are set to an empty string. I should probably make them not defined at all (conventional and easier to test with "DEFINED var").
Code:
WSCAN [/D "delims"] (varname | *) [varname | *] ... /S string
(a somewhat practical one) the file ipv4.txt is a collection of lines like:
Code:
1.0.0.0 1.0.0.255 01000000 010000FF apnic 256
Code:
v:\> wscan IPSTART IPEND * * INETREGISTRY /s %@line[u:\inet\ipv4.txt,9170]
Code:
v:\> set
INETREGISTRY=arin
IPEND=207.45.71.255
IPSTART=206.253.144.0
Code:
v:\> wscan /D "13579" v1 v2 v3 /s 0123456789
v:\> set
v1=0
v2=2
v3=4
v:\> wscan /D "13579" v1 v2 v3 v4 v5 v6 /s 0123456789
v:\> set
v1=0
v2=2
v3=4
v4=6
v5=8
v6=