in reply to Converting multiple unix timestamps
Condensing what you already have, a short oneliner makes the job done:
perl -pe "s/\b([0-9]{10})\b/localtime($1)/ge" file_with_timestamps.txt + > file_with_dates.txt
Generally I always use scalar localtime (time) but here there is no need. The above is already quoted for windows, where it seems you are (doublequotes for the oneliner).
L*
PS I had a mistake in the above oneliner perl -pne instead of perl -pe it worked the same way ( p overtake n ?). Npw corrected.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Converting multiple unix timestamps -- oneliner
by Laurent_R (Canon) on Jul 28, 2018 at 18:16 UTC |