Re: Searching in a line



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



.