Trying to understand if ReadList can be seed-up. I have a text file with columns of strings and numbers, some of numbers are in Fortan form. To import that in Mathematica I use command like:


with appropriate numbers of Word and Number depending on concrete file (they can vary). With a file of about 35000 rows and 30 columns it takes about 1 second. Is this a decent speed? Could it be improved further?

  • $\begingroup$ Do you need it to be faster? 1s is pretty fast for most things... $\endgroup$
    – MarcoB
    Mar 16, 2023 at 13:15
  • $\begingroup$ @MarcoB, I'm just curious if there are some tricks/technics for fast import txt files. $\endgroup$
    – LittleCat1
    Mar 16, 2023 at 13:24
  • $\begingroup$ If I was interested in this I'd be trying to measure the time to read the same file with whatever was the fastest non-Mathematica tool I could find (I dunno, cat or something) to see if I could figure out the overhead of using Mathematica and then decide whether or not ReadList is fast (enough). Probably have to work with much larger files to get useful numbers though. $\endgroup$ Mar 16, 2023 at 17:18


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.