Re: parse file into hash

2002-06-06 Thread Janek Schleicher
Alaric Joseph Hammell wrote at Wed, 05 Jun 2002 20:47:55 +0200: > Hello, > I am new with perl and was hoping to get some direction. > > I am attempting to parse a the attached .txt file. > > i need to be able to access the information by unique keys, QUAD_NAME and >USGS_QD_ID. Also, I wan

RE: parse file into hash

2002-06-05 Thread David . Wagner
Uncertain if this is as big as it gets or what, but I tried this: where %Myusgs is keyed from $USGS_QD_ID [0] points to Quad name [1] points to element of array holding input data %Myquad is keyed from $QUAD_NAME

RE: parse file into hash

2002-06-05 Thread Balint, Jess
Well, I am no genius, but something like this should get you started. You'll have to strip off the first line though for this to work. #!/usr/local/bin/perl -w use Data::Dumper; open( INPUT, "landuse_filenames.txt" ); while( ) { chomp; ( $FILE_NAME, $USGS_QD_ID, $QUAD_NAME, $ST

Re: parse file into hash

2002-06-05 Thread Michael Fowler
On Wed, Jun 05, 2002 at 02:47:55PM -0400, Alaric Joseph Hammell wrote: > I am attempting to parse a the attached .txt file. > > i need to be able to access the information by unique keys, QUAD_NAME and > USGS_QD_ID. Also, I want to be able to do a somewhat less exact access byt > ST_NAME. > > I

RE: Parse file

2001-09-05 Thread Rob Dixon
assigned in the order of the open bracket within the regex. HTH, Rob > -Original Message- > From: Weaver, Charles [mailto:[EMAIL PROTECTED]] > Sent: 05 September 2001 13:37 > To: 'Rob Dixon' > Subject: RE: Parse file > > > Hello, I know I was not the intend

RE: Parse file

2001-09-05 Thread Bob Showalter
> -Original Message- > From: Jorge Goncalvez [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 05, 2001 5:49 AM > To: [EMAIL PROTECTED] > Subject: Re:Parse file > > > Hi, I have a file which looks like : > > dhcpd : LOG_INFO : Internet Software Consortium DHCP Server 2.0 > dhcpd :

RE: Parse file

2001-09-05 Thread Rob Dixon
Hi Jorge This does what you want, and I think is fairly straightforward. The line 'local $/' temporarily undefines the record separator for the scope of the enclosing block, so that the read on the next line pulls in all of the file. (I assume your files aren't any bigger than you showed us?)