linux - how to add space of a number after first four one space then after two one space etc using awk -
i want add multiple spaces of number "20120911162500
" add space first 4 after every two.
desired output is
2012 09 11 16 25 00
this tried:
echo "2012 09 11 16 25 00" |sed 's/.\{4\}/& /g'
but output 2012 0911 1625 00
.
this might work (gnu sed):
sed 's/../ &/3g' file
this prepends space third pair of characters , every 2 characters thereafter.
Comments
Post a Comment