Message Boards Message Boards

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

Importing .csv files in Mathematica Online

Posted 2 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

Fantastic! It works now. Thank you very much Neil. Have a good weekend.

Regards,

Arasan

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

POSTED BY: Neil Singer

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?

The suggestions from Rohit and Robert work on the desktop version of Mathematica. I do not think you can access your filesystem from Wolfram Cloud. I just tried it from my Mac and I also get an empty list. However, I can see my cloud files on the right hand side of the screen. I can access those files and that file structure using FileNames[".", Folder].

Try typing FileNames[] and you should get all the files in the Wolfram Cloud Home directory. You can dive down from there. To move your .CSV files there, you can drag and drop them into Home or a Folder.

Regards

Neil

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

Hi Robert/Rohitji

Thank you for taking the time to reply. Unfortunately, the results did not come out as expected (Please see attached). Not sure if it's of any use, but I'm using a Mac.

Regards,

Arasan

Attachments:
Posted 2 years ago
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

Group Abstract Group Abstract