Skip to main content
edited body
Source Link
uloBasEI
  • 3.1k
  • 2
  • 23
  • 18
$ sed -e 's/\(.\{16\15\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{4\}\)/\1\4\3\2/g' /tmp/test.txt

seems to do what you are expecting.

$ sed -e 's/\(.\{16\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{4\}\)/\1\4\3\2/g' /tmp/test.txt

seems to do what you are expecting.

$ sed -e 's/\(.\{15\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{4\}\)/\1\4\3\2/g' /tmp/test.txt

seems to do what you are expecting.

Source Link
uloBasEI
  • 3.1k
  • 2
  • 23
  • 18

$ sed -e 's/\(.\{16\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{4\}\)/\1\4\3\2/g' /tmp/test.txt

seems to do what you are expecting.