I would like to read in really large text files (about 2GB) into Mathematica. The structure of the file is such that the first row and the first column are text i.e strings. Rest is all numbers. Is it possible to take advantage of this and make the Import faster? Currently I do Import["file.txt","Table"]. It takes a long time. I would like the output list to be same as that returned by the previously mentioned Import command.
Thanks for your help.
Importis often about the slowest you can have, particularly for tabular data.BinaryRead(List)can be much faster, and Java can give you still much faster reads, when one uses buffer reads – Leonid Shifrin Dec 04 '12 at 20:06BinaryReadListcan give you more speed thanImport- you can see one of the links in comments above for an example. Also,I linked to another answer of mine, where I used Java to get the file read into Mathematica 50x faster than with BinaryReadList. That answer was tailored to the specific question, but it shows how to do that. – Leonid Shifrin Dec 04 '12 at 21:12