How to create a file where the columns are separated by equal space

Yes, as @Tamas_Papp said, @printf is quite easy to use for this:

using Printf
ar = [[1, 85645, 197111, 197240], [1, 203753],[1, 24]]                  

loop = 0
for i =1:length(ar)
    val = ar[i]' .-1
    @printf("NetDegree : %-2d n%d ", length(val), loop)
    @printf("\n")
    for jj = 1:length(val)
        vv = val[jj]
        @printf("\t\t o%-6d  I : %9.6f, %9.6f", val[jj], 5.000000, -5.000000)
        @printf("\n")
    end # end of jj
    loop += 1
end # end of i

Output:

NetDegree : 4  n0 
         o0       I :  5.000000, -5.000000
         o85644   I :  5.000000, -5.000000
         o197110  I :  5.000000, -5.000000
         o197239  I :  5.000000, -5.000000
NetDegree : 2  n1 
         o0       I :  5.000000, -5.000000
         o203752  I :  5.000000, -5.000000
NetDegree : 2  n2 
         o0       I :  5.000000, -5.000000
         o23      I :  5.000000, -5.000000
2 Likes