[Date Index] [Thread Index] [Author Index]
Re: Print numbers to ASCII file with precise column widths
Dan's solution works excellently (thanks so much!). I have made it a function ("eFormatPrint"), and I combined it with an "f-format" function (using PaddedForm) to give me a "gFormat" function with string output like [you need to view in a non-proportional font]: For[i = 1, i <= Length[data], i++, Print[ gFormatPrint[ data[[i]], 10, 3] ] ] 1.235 1.235e7 1.235e-12 -1.235e-12 2.000 11.000 [With a fixed font, each value lines up right-justified in column 10}. I've put these into a package "NumericalFileIO", useful for formatted ASCII read and writes.