Hello to everyone
It's possible format a value inside the "Ctrl+C" clipboard?
Ex. i copy a value (DD/MM/YYYY) so i format (DD/MM/YYYY) in a (YYYYMMDD) inside clipboard, then i press Ctrl+V it ill paste the same value formatted (YYYYMMDD)
format a date inside clipboard
-
- Posts: 8
- Joined: 25 Mar 2019, 07:52
Re: format a date inside clipboard
Hallo,
try this:
(only exactly the copied date)or that:
(all dates at once)
try this:
(only exactly the copied date)
Code: Select all
#Persistent
OnClipboardChange("format_a_date")
return
format_a_date()
{ ;formats "30/03/2019" to "20190330"
If RegExMatch(ClipBoard, "\A(\d\d)/(\d\d)/(\d\d\d\d)\z",D)
ClipBoard := D3 D2 D1
}
(all dates at once)
Code: Select all
#Persistent
OnClipboardChange("format_all_dates")
return
format_all_dates()
{ ;formats all "30/03/2019" to "20190330"
If RegExMatch(ClipBoard, "\d\d/\d\d/\d\d\d\d")
ClipBoard := RegExReplace(ClipBoard, "(\d\d)/(\d\d)/(\d\d\d\d)", "$3$2$1")
}