I'm trying to export a 1000*100 matrix of numbers to a .dat
file using Export
(I want the numbers to be separated by a tab) and it's very slow, it takes several minutes, whereas when I export to an Excel file it takes a few seconds.
Is there a way to speed this up ?
Also how can I control the number of decimals I want to export ?
Edit
I found the issue, this happens when I export my dat file on a network drive (at work), the export to an Excel file and a dat file must be implemented in different ways that produce different behaviours. Thank you though for the different interesting answers.
.dat
should take seconds rather than minutes. For example on my system, exporting a 1000x100 of random reals to a.dat
file takes about 2.6 seconds. $\endgroup$mat = RandomReal[1, {1000, 100}]; Export["test.dat", mat, "TSV"]; // AbsoluteTiming
runs in 2.3 seconds here. $\endgroup$