you just use a different regular expression with split.
In the original example the split was done at the whitespaces
the regex is /\s/. Now you want to split at whitespace colon
whitespace. The regex is /\s:\s/. If you want to allow more
than one whitespace you could /\s*:\s*/ like this. You pro
On Fri, Apr 20, 2001 at 05:00:37PM -0500, Sean C. Phillips wrote:
: Gurus,
:
: This was very timely and helpful. I've got another related question,
: hence the reply to this. What if I've got a stanza like:
:
: parm : parm1
: value : 100
:
: parm : parm2
: value : 101
:
: ... etc, and I w
Gurus,
This was very timely and helpful. I've got another related question,
hence the reply to this. What if I've got a stanza like:
parm: parm1
value : 100
parm: parm2
value : 101
... etc, and I want to keep the name of the parm and the value, and
trash the rest?
Thanks,
Grate
: I need to read a huge two column file; I only need the
: data from the second column; I need to asign it a
: variable to that column, for example $FILE, how do go
: about doing this; I appreciate your help.
How about:
while (<>) {
$FILE = (split)[1];
...
}
"split" by itself s
Peter Lemus asked:
> I need to read a huge two column file; I only need the
> data from the second column; I need to asign it a
> variable to that column, for example $FILE, how do go
> about doing this; I appreciate your help.
>
> the file looks like this
>
> md tony
> md ariba
> md arpa
If the
Peter Lemus wrote:
> I need to read a huge two column file; I only need the
> data from the second column; I need to asign it a
> variable to that column, for example $FILE, how do go
> about doing this; I appreciate your help.
>
> the file looks like this
>
> md tony
> md ariba
> md arpa
in th