New answers tagged

0

Note - The code below lets you access your data from the file name but it does not exactly do what you want. Lets say you have some data files named {file1.dat,file2.dat,file3.dat}. Keep the notebook with the code below in the same directory. SetDirectory[NotebookDirectory[]]; aLLfiles = FileNames[NotebookDirectory[] <> "*.dat"]; Table[ ...


2

To see how to extract information from filenames see this question. Notice that indexed variables, as described in the answers to this question may be more advisable than customized names created as in my answer. All that said, You can get the filenames (JPG in this example) fn = FileNames["IMG*.jpg"] {"IMG_20150417_103421814.jpg", ...


2

You can use Symbol and Formal Symbols. With[{\[FormalS] = Symbol["x"]}, \[FormalS] = 4]; x (* 4 *) For your case: filename = "file1"; With[{\[FormalS] = Symbol[filename]}, \[FormalS] = Import[filename <> ".dat"];] A symbol file1 is created by Symbol and formal s is used to hold it. Then this symbol (file1) is assigned the import. You can then ...


1

Try Import with the following argument: ImportString["10533 \"MENDOZAT \" 115.0000 : 1 1.00000 10533 \"MENDOZAT \" 115.0000 : 2 1.00000 10533 \"MENDOZAT \" 115.0000 : 3 1.00000", "Table", Delimiter -> "\t"]


2

Perhaps this will work for you. With[{dir = $HomeDirectory}, Module[{choice, result}, choice = SystemDialogInput["Directory", dir]; If[Head[choice] =!= String, choice, FileNameTake[choice, -1]]]] Two points. dir can be set to whatever starting directory you like. No matter where you start you will be able to navigate the whole file ...


2

Since Mathematica 8.0 we are in luck and there is a command called CreateArchive that can do this for us. Documentation: CreateArchive.


0

Online collaboration using a notebook interface is one of the many use-cases that the Wolfram Cloud was specifically built to address. See https://mathematica.wolframcloud.com/app/, and click around to explore. I'm not sure what level, if any, of subscription is needed in order to share saved notebooks, or whether you are able to make such notebooks public ...



Top 50 recent answers are included