Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Import[]' topicStudent Support Forum > General > Archives > "Import[]"

Next Comment >Help | Reply To Topic
Author Comment/Response
05/17/12 5:34pm

I have a problem with the Import function in Mathematica 7. I have several Import functions in one notebook and want to be able to change the folder where the input file is in quickly. So i created a string which i want to call up in the function:

folder = "foldername";

imp1 = Import[InputForm[StringJoin[folder, "/filename1"]],"Table"];
imp2 = Import[InputForm[StringJoin[folder, "/filename2"]],"Table"];

so, the function should be:
imp3 = Import["foldername/filename3"]],"Table"];

imp3 works but imp1 and imp2 won't. Can anyone tell me why?
i get the error:

Import::chtype: first argument "foldername/filename1" is not a valid file, directory, or URL specification.

URL: ,

Subject (listing for 'Import[]')
Author Date Posted
Import[] lukas 05/17/12 5:34pm
Re: Import[] Bill Simpson 05/20/12 11:51pm
Next Comment >Help | Reply To Topic