I have a File in Emeditor with date column with "December 30, 2021" & "2021-12-30" formats and i want to convert the entire column to "dd/mm/yyyy". How do i convert the entire column to my preferred format? Can you create a Macro for me?
Please make sure to update EmEditor version to the latest version including beta versions (v21.5.905 or later).
yyyy-MM-dd|yyyy-M-d|MMMM dd, yyyy|MMMM d, yyyy
below the check box. These are the date formats you want to search for, combined with a pipe (|
).\D dd/MM/yyyy
in the Replace with box. This is a resultant date format.If you prefer macros, you can write and run a macro like this:
document.selection.Replace("[1900-01-01 , 2100-12-31 \"yyyy-MM-dd|yyyy-M-d|MMMM dd, yyyy|MMMM d, yyyy\" ]","\\Ddd/MM/yyyy",eeFindReplaceSelOnly | eeReplaceAll,eeExFindNumberRange);
To run this, save this code as, for instance, NormalizeDate.jsee
, and then select this file from Select... in the Macros menu. Finally, select Run NormalizeDate.jsee in the Macros menu. You must select a column before you run this macro.
References:
Updates
As of v21.5.906 or later, please remove a space after /D
.