Skip to main content
deleted 2 characters in body
Source Link

Assuming the date format you have in your post is what you want, the following regex should fit your needs.

sed -E 's/(.*)\#(1[0-9]{9})(.*)/echo \1 $(date -d @\2@\1) \3/e' log.file

Be mindful of the fact this will only replace one epoch per line.

Assuming the date format you have in your post is what you want, the following regex should fit your needs.

sed 's/(.*)(1[0-9]{9})(.*)/echo \1 $(date -d @\2) \3/e' log.file

Be mindful of the fact this will only replace one epoch per line.

Assuming the date format you have in your post is what you want, the following regex should fit your needs.

sed -E 's/\#(1[0-9]{9})(.*)/echo \1 $(date -d @\1)/e' log.file

Be mindful of the fact this will only replace one epoch per line.

Source Link

Assuming the date format you have in your post is what you want, the following regex should fit your needs.

sed 's/(.*)(1[0-9]{9})(.*)/echo \1 $(date -d @\2) \3/e' log.file

Be mindful of the fact this will only replace one epoch per line.