Ask Your Question

How to share files across worksheets ?

asked 2011-06-02 00:27:23 -0500

Pedro gravatar image

updated 2011-06-16 08:24:46 -0500

Kelvin Li gravatar image

I want that code in several worksheets, from the same user, work over the same files. The DATA variable works only for the worksheet that uses it in a cell.

More, inside a new package: how to produce a path to that common directory over all worksheets of an user ?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2011-06-03 02:18:48 -0500

kcrisman gravatar image

updated 2011-06-09 08:43:12 -0500

This isn't possible with DATA, as you mention, unfortunately.

But there is the following workaround if you have permissions on your computer (for instance). I don't know whether this would work on a server, though presumably it might if you chmod the file in question appropriately?

Suppose you have a file you want to use at /Users/myusername/Downloads/List3000.sobj. Then

L = load('/Users/myusername/Downloads/List3000')

works in the notebook. I don't see any reason that as many worksheets as possible couldn't do that. You would need the full path, though.

The reason this works is because DATA just gives a full path as a string too:

sage: DATA


However, you can make a file accessible to other worksheets that you own by going to the Data dropdown menu, choosing the file, and then doing "create a linked copy to the worksheet" and choosing a worksheet. I don't know if this would help with your case or not.

edit flag offensive delete link more

Your Answer


Add Answer

Question Tools


Asked: 2011-06-02 00:27:23 -0500

Seen: 377 times

Last updated: Jun 09 '11