Re: How to read the second column of a file

2001-04-20 Thread Collin Rogowski
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

Re: How to read the second column of a file

2001-04-20 Thread Casey West
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

Re: How to read the second column of a file

2001-04-20 Thread Sean C. Phillips
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

Re: How to read the second column of a file

2001-04-20 Thread Timothy Kimball
: 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

Re: How to read the second column of a file

2001-04-20 Thread bbking
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

Re: How to read the second column of a file

2001-04-20 Thread Steve Lane
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