I am preparing data used by a command line program. It requires data in a simpliest possible format:
value_x1 value_y1
value_x2 value_y2
...
value_xN value_yN
For now I always need to use Python to process a datafile created in Mathematica that format, because Mathematica always adds quotes " or multiple blank spaces or tabs. How can I create a file in a format:
<value_x1><single_space_sign><value_y1><end_of_line_sign>
<value_x2><single_space_sign><value_y2><end_of_line_sign>
...
<value_xN><single_space_sign><value_yN><end_of_line_sign>
OpenWrite[]
, Write[]
, Export[,"Table"]
etc. produce files with additional characters, and therefore are useless without processing in Python.
Edit: What if I needed to create a file in a format:
<value_x1><single_space_sign><some string character><value_y1><end_of_line_sign>
<value_x2><single_space_sign><some string character><value_y2><end_of_line_sign>
...
<value_xN><single_space_sign><some string character><value_yN><end_of_line_sign>
Edit 2: Proposed answer:
dat = Table[{i, Sin[i]}, {i, 4}] // N;
Export["test.dat", dat]
produces file containing following data:
{1., 0.8414709848078965}
{2., 0.9092974268256817}
{3., 0.1411200080598672}
{4., -0.7568024953079282}
Which is useless.
{}
. What I am asking: is this "small variation" which I can't figure out. $\endgroup$