Page 1 of 1

How to change date timestamp so it's the same in each line

Posted: Sat Jan 01, 2011 12:53 am
by steve1040
I have date like this: The field should be YYYYMMDD HH:MM:SS

|20100905 23:59:00
|20100905 23:59:00
|20101123 13:05
|20101123 13:05:00
|2010116 10:10
|2010116 10:10

I would like to change the lines that do not have a 2 digit Day or a second

So the Data should like this
|20100905 23:59:00
|20100905 23:59:00
|20101123 13:05:00
|20101123 13:05:00
|20101106 10:10:00
|20101106 10:10:00

I can find the date field with this : (2010)([[:digit:]]{1})([[:digit:]]{2} )

but I don't know what to do for replace


Thanks
Steve

Posted: Sat Jan 01, 2011 1:32 pm
by steve1040
Nevermind I got it

Find: (2010)([[:digit:]]{2})([[:digit:]]{1} )

Replace: \1\20\3

I did something like this for the time also

Posted: Sat Jan 01, 2011 6:41 pm
by MudGuard
How do you determine whether
2010116 10:10 means 2010-01-16 or 2010-11-06?