Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.6K Views
|
13 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Importing .csv files in Mathematica Online

Posted 3 years ago
13 Replies

I had a typo, you need to grab the first (and only element) in the list:

Import[myfile[[1]]]

or do

Import["Copied Files/Variables.csv"]

Regards

POSTED BY: Neil Singer

Ah!,

Your problem is Copied Files is a string -- you need quotes around it. You also need a proper full path to the file. You can do something like this (or type the full file name):

myfile = FileNames["Copied Files/Var*.CSV"]

and your file will be found.

data = Import[myfile]

Regards,

Neil

POSTED BY: Neil Singer

Thanks Neil, unfortunately it's still showing an error. Please see below.

enter image description here

I was able to bring up a finder window and drag the files from the Mac to the home directory on the right hand side of the browser window (the region just below where the image below cuts off. Alternatively, there is an upload files button on the top of the right hand side -- highlighted in blue below.

enter image description here

Regards

Neil

POSTED BY: Neil Singer

Thank you Neil, it now puts to bed to my search on how to access my filesystems via the Online version. So the only option is via the cloud files and I can see the folders in the Cloud Home Directory as per the method you suggested. However, I am not able to import the csv files in the cloud folders. Any idea how this can be done. I tried Import with the filename.csv and specifying the folder within the cloud that has the file but it returned "file not found during import". Please see attached.

Thanks and regards

Arasan

Attachment

Attachments:

Thanks Neil, Perhaps I was not clear on the 2nd part of my question. Now that the files are in the cloud, how do you import them into Mathematica Online? As you can see I have tried importing them from the cloud but it returns an error that the file is not found when it is in fact on the cloud. What am I missing here?

POSTED BY: Neil Singer

Hi Arasan

I have only two explanations for you:

  1. the folder does not contain any .csv files

  2. the folder spec is wrong

If I try it on an non existing Folder I also get an empty List:

FileNames["*", "Blabla"]
(* { } *)

Robert

POSTED BY: Robert Nowak

Thanks for the quick feedback Robert

As you can see from the screenshot the folder does contain .csv. files. On the folder specs are you referring to the path? Not sure if I understand you correctly.

Thanks

Arasan

Posted 3 years ago

On the desktop and cloud this should work.

FileNames["*.csv", Folder]
POSTED BY: Rohit Namjoshi

Hi,

your example will look for "Variables.csv" only this file will be listed if it exists and no other will be listed.

Perhaps you intended:

FileNames["*.csv", Folder] 

Robert

POSTED BY: Robert Nowak
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard