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 need to export a file with the extension .mac (short for macro in an external program), though it is essentially a text file (saving .mac in Microsoft notepad works fine). However if I try something like:

Export["test.mac", "The brown fox."]

I recieve the error:

Export::infer: Cannot infer format of file test.mac. >>

Is there a workaround?

share|improve this question
Export["test.mac", "The brown fox.", "Table"] is ok? Or other, take a look at Deatils section for Export. – Kuba Sep 17 '13 at 10:09
@Kuba Yes, that did it! – user9563 Sep 17 '13 at 10:11
up vote 9 down vote accepted

Export takes a third argument that specifies the format:

Export["test.mac", "The brown fox.", "Text"]

Import["/tmp/test.mac", "Text"]
(* "The brown fox." *)
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.