Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.