sed 's/./&;/59; s//&;/43; s//&;/11' <in >out
I'm not sure if you want the
; to be the twelfth, forty-fourth, or sixtieth character on a line or to follow it. If the latter, either add one to all of those numbers and risk appending a semicolon to the very end of the line (if that matters) or see below. As it is written, above, though,
sed won't append a sixtieth char if there isn't already a fifty-ninth.
To do insertions as opposed to appending:
sed 's/./;&/60; s//;&/44; s//;&/12' <in >out
...is another way. In this case
sed will never append a semicolon to the tail of the line - semicolons are only inserted at the sixtieth character position (for example) if after doing so there will definitely be a sixty-first.
The three substitutions are not mutually dependent. Either way it is written,
sed will add either one, two, or three semicolons to a line depending on its length. Any line with fifty-nine or sixty chars will get three, shorter lines that are at least longer than forty-two or forty-three chars get two semicolons, and other lines matching at least eleven or twelve characters are edited only the once. Lines with fewer than eleven characters are not affected.
If you wanted to only affect lines which were long enough to justify all three semicolons:
sed -e's/./;&/60;ts' -eb -e:s \
-e's//;&/44;s//;&/12' <in >out
...that would work.
...with a GNU
minised) you can
Test a substitution for failure rather than only for success as well:
sed -e's/./&;/59;T; s//&;/43; s/&;/12' <in >out