Ben Crane wrote:
> Jaschar Otto,
> 
> Yep, you're right with the second guess :-) I didn't
> explain it too well so apologies from me. Actually,
> I'm creating a log file parser where the results can
> be placed into a mysql database.
> 
> Most log file analyzers use [15/Jan/2003:11:25:46
> +0000] and split the date and time...but I want to
> split day, month, year, hour, minute, second and then
> time difference as it'll be easier to process/analyze data once in
> mysql. 
> 
> So I want to seperate [15/ to 15, then /Jan/ to Jan,
> then /2003: to 2003 and so on...

You can split using a character class:

$ perl -le 'print for split /[[\/:+\]]/, "[15/Jan/2003:11:25:46+0000]"'

15
Jan
2003
11
25
46
0000

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to