Smart inserting od colons

Joined
Dec 5, 2022
Messages
2
Reaction score
0
I have a column of minutes/seconds stamps, but without a colon, ie. 1245 [as 12:45] or 4555 [as 45: 55]. Is there a shortcut method of inserting the colon between the 2nd and 3rd digits?
 

macropod

Microsoft MVP
Joined
Mar 2, 2012
Messages
580
Reaction score
50
You could do that with a fairly simple wildcard Find/Replace, where:
Find = <([0-9]{1,2})([0-9]{2})>
Replace = \1:\2
If you have other 3-4 digit numbers (e.g. years, numbers with thousands separators), I recommend not using ReplaceAll.
 
Joined
Dec 5, 2022
Messages
2
Reaction score
0
You could do that with a fairly simple wildcard Find/Replace, where:
Find = <([0-9]{1,2})([0-9]{2})>
Replace = \1:\2
If you have other 3-4 digit numbers (e.g. years, numbers with thousands separators), I recommend not using ReplaceAll.
Thanks! Can you tell me, is there any book to learn such tricks?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top