using sed to retrieve the hour in a timestamp



Greetings.

I have a ksh script that greps the contents of a log file, into an
array, selecting only what I want.

the output to a CSV looks like this:

Jun 1 2005|21:08:34|/dir1/dir2/dir3/dir4/filename.txt

the time stamp (21:08:34) is a value in my array and I want to extract
only the hours from it to use elsewhere. in this case, "21"

my knowledge of "sed" is pretty limited, so I'm not sure how I could
parse

${ARRAY[ARRAYINDEX+3]} to return only "21".

Please let me know if you have any suggestions. I'd also like to use
the same approach to return only the filename. basename doesn't like
the size of the array.


Thanks a lot!!!

.



Relevant Pages

  • Re: modifying putty to include the symmetric key in the logs
    ... 'keyspace' is an array of 'unsigned char' values, ... Of course such an attacker would become able to ... logged in cleartext _in_ the log file, so an attacker able to read ...
    (comp.security.ssh)
  • Re: regExp
    ... > It uses ReadAllto store the entire log file into an array then it uses ... ReadAll() is not suitable for "find" style log parsing because it's ... Of course if it's just a script for Juan to run himself, ...
    (microsoft.public.scripting.wsh)
  • New to Perl. Need some guidance with what to do..
    ... I have a log file which tracks orders that are placed. ... that order will be given a unique identifier. ... customers decides to change the order, the replaced order will be given a ... Well, I can get the first two ids into the array, but I am not ...
    (comp.lang.perl.misc)
  • Re: annoying dhclient error messages
    ... > connection. ... The problem is that I get the following annoying error ... > bytes at end of array ... into a new log file, and block them from the console. ...
    (freebsd-questions)
  • Re: Using sortrows on mixed-type cell arrays
    ... I read the log file into a Matlab cell array, everthing is string ... I now want to sort the rows of the array first by then ...
    (comp.soft-sys.matlab)