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 saved a expresion to a file like this


Then (i don't know why) when I import the file i get the compressed expresion embedded in a nested list like this:

test = Import["file.dat"] (* test -> {{ compressedString }} *)

So I use this to Uncompress the expresion:

myExp = Uncompress@First@Flatten@Import["file.dat"];

And I get my expresion back correctly, but i get these msg

Union::normal: Nonatomic expression expected at position 2 in <<1>>. >>
Union::normal: Nonatomic expression expected at position 2 in <<1>>. >>

Should I worry about those msg? Why am I getting those?

You can check for yourselves:

share|improve this question
The .dat file is assumed to contain tabular data, so Import gives you a 2D list. You can use Import["file.dat", "Text"] to get the string directly. The messages are presumably coming from the evaluation of myExpression – Simon Woods Apr 3 '14 at 19:35
up vote 1 down vote accepted

It seems there is a undefined variable games in the compressed data. The code in the compressed data attempts to do a union on this games variable and some lists. So essentially, the error you get is the same one caused by

Union[{}, games]

To see it for yourself, try using Uncompress with two arguments. I suggest to use HoldComplete as a second argument.

We then have

MatchQ[heldData, HoldComplete[Union[___]]]


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.