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

Hi

I have just subscribed to Mathematica Online and for the pass couple of days going through the various tutorials. However, when it comes to importing data I have hit a huge roadblock. Appreciate any guidance I can get.

Thanks and regards

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
POSTED BY: Neil Singer
Posted 3 years ago

On the desktop and cloud this should work.

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

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

Regards,

Arasan

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

enter image description here

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, 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?

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

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

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:

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