I want to convert the timestamps in a .zsh_history
file to their readable equivalents.
Is there some search and replace I can do in emacs that will replace the time with something like (format-time-string unixtime)
?
: 1568128379:0;cp -a ~/.zshrc.pre-oh-my-zsh ~/.zshrc
: 1568128381:0;exit
You must log in or register to comment.
C-h a replace-regexp
, select the function, and look at its help string.The solution will end up looking something like:
M-x replace-regexp : \([0-9]+\):\(.*\) \,(+ 1 \#1):\2
But with
(format-time-string)
instead of my(+1 1 \#1)
; I don’t know time formatting functions in emacs elisp off the top of my head, sorry.(Or use
query-replace-regexp
if you want interactivity.)This same question was asked in stack exchange: https://emacs.stackexchange.com/questions/79221/is-it-possible-for-a-query-replace-regex-to-replace-the-value-with-a-computed-va
Yes, I know it’s the same guy.