awk
can also be used to reformat an unknown number of integers per-line zero-padded to 6-digits by looping from 1-NF
and outputting the reformatted value. You can determine the delimiter to be placed between them by conditionally outputting the delimiter of choice in your printf
format string. For space separated values you could use:
$ awk '{for (i=1; i<=NF; i++) printf (i>1)?" %.6d":"%.6d", $i; print ""}' file
000324 000359
001348 001384
That will eliminate your fixed format dependence on two-integer values per line.
Example Input File
$ cat file2
324 359 12
1348 1384 991
11 101 1001
Example Use/Output
$ awk '{for (i=1; i<=NF; i++) printf (i>1)?" %.6d":"%.6d", $i; print ""}' file2
000324 000359 000012
001348 001384 000991
000011 000101 001001