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

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
steve1040
Posts: 39
Joined: Fri Oct 13, 2006 2:19 am

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

Post 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
steve1040
Posts: 39
Joined: Fri Oct 13, 2006 2:19 am

Post 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
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

How do you determine whether
2010116 10:10 means 2010-01-16 or 2010-11-06?
Post Reply