My intention is to write 2612 lines into a file containing 7 values, 6 of which have a label in increasing order from 1-6. The output has undesired additional spacing separating the values.
I am using:
for i=0,2611 do printf, 5, col13(i),' 1:',col1(i),' 2:',col2(i),' 3:',col3(i),' 4:',col4(i),' 5:',col5(i),' 6:',col6(i)
An example of the output I am getting:
0.898083 1: 23.4910 2: 22.9830 3: 22.3010 4: 21.4080 5: 20.8960 6: 3.17989
desired output:
0.898083 1:23.4910 2:22.9830 3:22.3010 4:21.4080 5:20.8960 6:3.17989
All insight is very much appreciated! Thanks.
How about the following?
IDL> print, randomu(seed, 6), format='(%"%f 1:%f 2:%f 3:%f 4:%f 5:%f")'
0.333924 1:0.478652 2:0.962699 3:0.827317 4:0.862164 5:0.465218
For your code, you could do something like:
format = '(%"%f 1:%f 2:%f 3:%f 4:%f 5:%f")'
for i = 0, 2611 do begin
print, col13[i], col1[i], col2[i], col3[i], col4[i], col5[i], format=format
endfor