using sed to retrieve the hour in a timestamp
- From: landre@xxxxxxxxx
- Date: 28 Sep 2006 11:21:58 -0700
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!!!
.
- Follow-Ups:
- Re: using sed to retrieve the hour in a timestamp
- From: Michal Nazarewicz
- Re: using sed to retrieve the hour in a timestamp
- Prev by Date: Re: Remove the first 3 characters after reading each line
- Next by Date: From a bash array to a csv file line?
- Previous by thread: Remove the first 3 characters after reading each line
- Next by thread: Re: using sed to retrieve the hour in a timestamp
- Index(es):
Relevant Pages
|