I don't know why I can't get my files to import from my flashdrive into my notebook.

I have .mat files and .cvs files.

I've tried this


and this


and this


and this for the cvs


with the same variations as above.

LocalDisk(E:) is the flashdrive and MOptics is the folder.

  • $\begingroup$ What operating system are you on? $\endgroup$
    – Jinxed
    Commented Apr 10, 2015 at 17:22
  • $\begingroup$ windows paths look like: "E:\\MOptics\\..." (single forward slash should work as well ) $\endgroup$
    – george2079
    Commented Apr 10, 2015 at 17:28
  • $\begingroup$ Windows. I am working on a school computer so I was trying to import them off a P drive at first which it didn't like either $\endgroup$ Commented Apr 10, 2015 at 17:28
  • $\begingroup$ "E:\\MOptics\\. didn't work $\endgroup$ Commented Apr 10, 2015 at 17:31
  • $\begingroup$ What Mathematica is this? 10? $\endgroup$
    – Jinxed
    Commented Apr 10, 2015 at 17:32

1 Answer 1


Here is what worked in my case:

First open a new notebook.

Save it to your flashdrive, into the same folder where your "csv" files are located.

type in:




Now you know exactly how the filename is represented in your system. I am on a mac, thats why my filenameSeperators are represented as "/". Go to your notebook located at your harddrive and type in:

dir = "/Volumes/TRANSCEND/MOptics/";

Its practical to save your SD-directory to a variable and use FileNameJoin. FileNameJoin is OS-independent and uses automatically the correct filenameseparator for your system.


completely system-independent solution:

Get a directory list from your folder located at flashdrive:

dirList = FileNameSplit[NotebookDirectory[]]


{"", "Volumes", "TRANSCEND","MOptics"}

Importing a File from hdd:

dirList = {"", "Volumes", "TRANSCEND", "MOptics"};
Import[FileNameJoin[Append[dirList, "sun1.csv"]]]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.