In older versions of MathematicaMathematica you could use SpaceFormSpaceForm
to leave a certain amount of spaces when writing to a file. For example, if we have the following data:
data = Table[{x, N[Exp[2 - x]]}, {x, 0, 40, 5}];
data = Table[{x, N[Exp[2 - x]]}, {x, 0, 40, 5}];
We can then write it to a file
MapThread[Write["file.txt", FortranForm[#], SpaceForm[4], FortranForm[#2]]&, Transpose[data]]
MapThread[Write["file.txt", FortranForm[#], SpaceForm[4], FortranForm[#2]]&, Transpose[data]]
You can still use SpaceFormSpaceForm
in the current version of MathematicaMathematica but it seems there is no documentation for it. I'm just wondering if that function was replaced by a newer one or how to do the same thing with a documented function.