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 am trying to import a file:

filename = "furan.b3lyp.6-31G*.sdat"
path = "/home/molkee/Desktop/plots/scr/" <> filename;
FileExistsQ[path]
data = Import[path, "Table"];

I am getting the Recursion Limit error. I guess this happens because of the asterisk in the filename, but why?

What is going on? What is the right way to import it?

FILE

share|improve this question
    
MMA is interpreting * to mean a wildcard (placeholder for 0 or more characters). I'm not on a Linux machine (Windows doesn't allow * in filenames) so I can't test this, but "furan.b3lyp.6-31G" <> Verbatim["*"] <> ".sdat" might work. Or Verbatim around the whole thing. –  mfvonh Jun 18 at 17:59
    
Is possible to "escape" the star in a filename using a special character? \ or something? –  molkee Jun 18 at 18:11
    
Oh right I didn't think about that. Probably: try \\* –  mfvonh Jun 18 at 18:11
1  
@molkee Works like a charm for me, see here. –  Öskå Jun 18 at 18:18
1  
I can confirm this, redhat linux, mma 9.0.1 With my own very simple file. Open fails as well so it is not to do with Import. The workaround is to not use * in linux file names ( seriously this is bad for other reasons ) –  george2079 Jun 18 at 19:55

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.