In Emeditor, how do i get the number of days between 2 date columns? Example:
-> Column C: 4 days
Sample:
1/1/2022,1/2/2022,
1/1/2022,2/2/2022,
1/1/2022,3/2/2023,
The 3rd column must be an empty column. Assuming the date format is the system date format. In this case, it is the US format (m/d/yyyy).
Select the 3rd empty column by clicking the 3rd column heading.
Press Ctrl+H to show the Replace dialog box, and enter
.*
\J d1=new Date(cell(-2)); d2=new Date(cell(-1)); diffTime=Math.abs(d2-d1); Math.ceil(diffTime / (1000*60*60*24));
The result will be:
1/1/2022,1/2/2022,1
1/1/2022,2/2/2022,32
1/1/2022,3/2/2023,425
References