Re: Searching in a line
- From: "Jürgen Exner" <jurgenex@xxxxxxxxxxx>
- Date: Wed, 29 Aug 2007 21:50:35 GMT
lerameur wrote:
On Aug 29, 5:25 pm, "Jürgen Exner" <jurge...@xxxxxxxxxxx> wrote:
lerameur wrote:
I want to do a search in a log file. each line has the following
pattern:
34,56,,9,0,0,,,,65;
So there 10 section. How do I parse through different sections?
perldoc -f split
meaning I want section 4, which is the number 9
$sec4 = split($value)[3]
either way I am getting these error messages:
./spam2: my: command not found
./spam2: line 6: unexpected EOF while looking for matching `"'
./spam2: line 10: syntax error: unexpected end of file
Ok, ok, that split() syntax is not correct, I forgot to specify the pattern.
If you had included a self-contained minimal program then I could have
tested my suggestion and that would not have happened.
As for the other error messages: you didn't show us your program, therefore
there is no way for us to see what is wrong. Have you read the posting
guidelines that are posted here frequently?
jue
.
- Follow-Ups:
- Re: Searching in a line
- From: Jürgen Exner
- Re: Searching in a line
- References:
- Searching in a line
- From: lerameur
- Re: Searching in a line
- From: Jürgen Exner
- Re: Searching in a line
- From: lerameur
- Searching in a line
- Prev by Date: Re: Searching in a line
- Next by Date: Re: Mac: Perl script that will run when double-clicked
- Previous by thread: Re: Searching in a line
- Next by thread: Re: Searching in a line
- Index(es):