0
$\begingroup$

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:

ReadList["path_to_file",{Word,Word,Number,Number,Number}]

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?

$\endgroup$
3
  • $\begingroup$ Do you need it to be faster? 1s is pretty fast for most things... $\endgroup$
    – MarcoB
    Mar 16 at 13:15
  • $\begingroup$ @MarcoB, I'm just curious if there are some tricks/technics for fast import txt files. $\endgroup$
    – LittleCat1
    Mar 16 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 at 17:18

0

Your Answer

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

Browse other questions tagged or ask your own question.