1 of 1
123
  • 1.6k
  • 7
  • 9

With GNU sed

sed ':;s/^.\{0,9\}$/& /;t;s/^.\{10\}$/&-9/' file

Adds one space as long a the number of characters is below ten using test t.
Then replaces lines with ten character with themselves and -9.

123
  • 1.6k
  • 7
  • 9