using sed to grab two characters?
I am new to sed, but it seems to me this may be able to do what I want. I need to be able to capture two integers from a variable. I have a variable holding a date and time in the form YYYYMMDDHHMMSS.
For example if I have a variable holding 20040419204537, and I want to grab the hour (20) and place it in a new variable.
Also, if possible, I would like to be able to capture the first 8 characters and put them into a new variable (20040419)
Thanks for any help you can give!