Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am attempting to perform a comparison of pseudorandom number generation with the RAND Corporation's "A Million Random Digits with 100,000 Normal Deviates" for a Computational Physics course.

I have the text file, which is available from the RAND Website. I have tried Import and Import["data.txt", Table] with minimal success. My desire is to get this in a table format where I can then use them in a Monte Carlo simulation. I would prefer to be able to address this in the format "randData[m,n]" like addressing the value in an m,n matrix.

I am aware of similar questions, and have used the search. Thanks in advance for your assistance.

importing a matrix Importing data sets from plain-text files and performing operations on them

share|improve this question
up vote 2 down vote accepted
import = Import["c:\\users\\rasher\\downloads\\digits.txt"];
randData = Partition[ToExpression[StringSplit[import]], 11];

randData[[1, 10]]

( * 39292 *)

randData is [[line, column]] of the text, in numeric form.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.