RE: parse help
- From: rvm@xxxxxxxxx (Bob McConnell)
- Date: Mon, 9 Jul 2007 09:06:18 -0400
-----Original Message-----
From: geek.not@xxxxxxxxx [mailto:geek.not@xxxxxxxxx]
Sent: Sunday, July 08, 2007 10:49 PM
To: beginners@xxxxxxxx
Subject: Re: parse help
setting $/
No, the Input Record Separator ($/) can only hold one string.
However, your records are actually separated by "\n\n", so
to "\n\n" and then chomp'ing the record will give you..
No, it does n't work for me. I noticed there are some empty lines in
the 'comments' field. Let's say if i parse the record with two newline
characters, it does not fetch full record if the record contains empty
lines in the 'comment fileld'. Do you have any suggestion to avoid
this situation??
tx
karl
Define a state flag in your process loop that turns the parser off and
on. Turn on when it finds "host=", then turn off and save the record
when it finds "env=". That will work only as long as those are always
the first and last lines of every record.
The other option is to only use "host=" to close and open each record.
The first time there is nothing to save, and don't forget to save the
final record when you reach the end of the file.
Bob McConnell
.
- References:
- Re: parse help
- From: Geek.Not@xxxxxxxxx
- Re: parse help
- From: Chas Owens
- Re: parse help
- From: Geek.Not@xxxxxxxxx
- Re: parse help
- Prev by Date: Re: Memory leaks with threads
- Next by Date: Re: Problem with perl code
- Previous by thread: Re: parse help
- Next by thread: Use of uninitialized value in substr
- Index(es):
Relevant Pages
|