Script to make simple recurring ascii file edit

Hi,

I have an ascii file with recurring lines (the file is 36mb so lots of lines) which look like this:

-2.5 -66.324-68.138 935.2 1.953 -0.664 272.617 73.684 -2.428 269.998 0.000

Every 14 lines there is a blank line.

I would like to, for each non-blank line, introduce a space at the 15th character space in the line (i.e. in the above between the '4' and the '-' so I separate the two numbers to give -66.324 -68.138 rather than -66.324-68.138). I want this applying to the first 13 lines, but not the 14th, the next 13 lines but not the 25th, and so on.

Is a short shell script best to sort this? Any help is much appreciated.

Thanks Andy

Looks like character #12 to me, but:

awk -v FS="" -v OFS="" '{ if(length($1)) $12=$12 " " } 1' < infile > outfile

FS="" tells awk to split each character, whitespace included, into its own record. OFS="" tells awk not to cram spaces between records when printing.

The $12=$12 " " crams on a space after character number 12.

The if-statement makes it not do anything to blank lines.

That works great, thanks very much.

Andy

p.s. it was 14 because there were 2 blank spaces at the beginning of the line which hasnt shown upon posting the thread.