Questions on obtaining files and directory structure/information and manipulating the said structure/information, searching/renaming particular files in a directory, etc., in an OS independent manner.

learn more… | top users | synonyms

2
votes
1answer
54 views

Using Mathematica to batch-produce text files

I need to make a bunch of plaintext files, all of which differ only in a single parameter. The text I want to "copy" or "batch produce" is a little bit complex, since it contains quoted areas and ...
4
votes
0answers
80 views
+50

Creating compiled search TRIE file for argument string completion

I'd like to generate a compiled search TRIE file (like those found in $InstallationDirectory\SystemFiles\FrontEnd\SystemResources\FunctionalFrequency\) to help ...
-6
votes
0answers
51 views

rename files randomly

I need to read a directory with pdf files, rename them by numerical sequence of 8 digits when lifting with pdf extension, and then record the result (the idea is that they are totally random names ...
6
votes
1answer
84 views

How to make captions for a movie?

I'm trying to make my own video parody with custom subtitles. Creating your own custom subtitles file in a text editor with the SubRip or .SRT format is easy to do, it looks like this: Where ...
1
vote
0answers
53 views

Why do I get “There appers to be an error in the file named below”?

For first time in my life, I have just suffered the error: " "There appears to be an error in the file named below". "Parse and load the entire notebook upon opening.", doesn't help. I have saved ...
4
votes
2answers
214 views

Custom PopupMenu file selector

Lately I come across what I think not uninteresting problem which is a good exercise for the usage of Dynamic. Assume you have files in a directory structure (a ...
1
vote
1answer
65 views

How to delete notebook files from the Wolfram Cloud

I have version "10.0 for Mac OS X x86 (64-bit) (September 10, 2014)" I have several notebooks stored in the Wolfram cloud, but don't see how I can delete certain ones I no longer need.
2
votes
2answers
118 views

Is there the possibility to write many times a value in definite list of file1.nb?

The commands testData = RandomReal[{0, 1}, {1, 1}]; Export["C:\\Users\\Alex\\Desktop\\1\\file1.nb", testData]; write the “testData” (value generated by ...
16
votes
3answers
3k views

Relative paths for portable notebooks in Mathematica

I cannot find how to use relative paths in Mathematica. My directory structure is simple. ...
1
vote
2answers
85 views

How to join .txt-files without importing?

Is it possible to write a code, telling MMA to join 2 (or even more) .txt-files without importing them?
5
votes
1answer
229 views

Watch File in Directory .NET

How might I watch for a specific file to change in a directory using Mathematica/.NET code? The following works in .NET but fires twice when you change the file. ...
23
votes
2answers
6k views

How to import all files of a folder at once?

I know how to import one textfile by calling its name filestring = Import["myfile.tex", "Text"]; Then "filestring" is a string with the myfile content. How do ...
0
votes
0answers
55 views

Notebook contents changed upon re-opening

Cross-posted in http://tieba.baidu.com/p/4439694061 I was so puzzled that why in Mathematica after I saved the nb file and when I opened it again the contents changed totally? Another point that ...
22
votes
0answers
350 views

What is the difference between a .wl package and a .m package?

In Mathematica 10.x, one now has both .wl Wolfram Language Packages and .m Wolfram Mathematica Packages. What's the ...
1
vote
2answers
45 views

Why autocompletion of file name is not working in notebookdirectory?

I use windows system and Mathematica 10 The default working directory is c:\\user\\name\\document If I type Import["xx , ...
6
votes
3answers
290 views
2
votes
0answers
53 views

Using DirectoryQ difference with windows and Unix naming, forward slash problem

update: send email to Wolfram support. CASE 3561304. Will update if they confirm this is a bug or not. Should Mathematica DirectoryQ["z/"] return False when the ...
1
vote
1answer
59 views

Inconsistency of WriteString

Important Note A kernel or maybe Front End restart probably fixed the problem. I did something weird today which is evaluate Context[StringQ]="test`", perhaps that ...
18
votes
2answers
238 views

How to find the package file that stores a certain symbol?

Is it possible to figure out in what file a certain packaged symbol lives in (assuming there is no shadowing between multiple identical symbol names)? I would like to have a function that if, given a ...
0
votes
1answer
39 views

Finding text files in a given path and applying a function to those files

I made a function called "SolveLinearSystem[]" that solves,as its name suggests, a linear system of any amount of variables. It takes the path of a text file as its only argument. The function then ...
3
votes
1answer
48 views

What causes the error NotebookEvaluate::nbnfnd?

Help says: NotebookEvaluate can take either a NotebookObject or a filename referencing a notebook file. therefore, I wonder why ...
0
votes
2answers
63 views
0
votes
1answer
58 views

How to set the current Directory as the default?

Everytime, before my code, I always write, SetDirectory[NotebookDirectory[]]; So, how to make this as the default ?
5
votes
0answers
71 views

How to unlock a stylesheet which is not needed anymore by the FrontEnd

Problem: So, if your notebook has a private stylesheet and it has a parent stylesheet, you can't delete that parent, in the same FE session, after the notebook is closed. Minimal example: We are ...
1
vote
1answer
41 views

DOS-like Wildcard for Filtering List of Files [duplicate]

I have a list of file names that I would wild like to filter based on a DOS like wildcard specification similar to what can be used as the first argument,"forms", of ...
3
votes
2answers
84 views

Cannot find BaseDirectory or UserBaseDirectory in Mac OS El Capitan

I am new to Mac OS, so this might be a silly question, but.... I just searched for $BaseDirectory and $UserBaseDirectory in my ...
3
votes
1answer
123 views

Set permission of created directories by CreateDirectory

What determines permission mask of directories created by CreateDirectory? Calling CreateDirectory["/tmp/dir"] gives ...
0
votes
1answer
25 views

FileBaseName and a dot in the folder name

FileBaseName["F:\\2016-02-23\\11.5_mm_fan_off_pumps_off_1500_hz_3793_\ images_2048_1472_pixels_20160223_1649_time_part"] should give the base folder name: ...
0
votes
0answers
58 views

Why does this code produce an infinite loop?

I can't understand the way this code behaves and suspect that is because of some unrecognized reasons of general interest. Otherwise, I apologize and will retire the question. In ...
5
votes
2answers
72 views

how to get the size of a directory(total size of all files under this directory or its subdir or …)

I use Mathematica10 in my Win7 and I want to estimate the amount of disk space occupied by each dirs. I try the code(the code was copied from How do I find the amount of free space on disk?, actually ...
6
votes
0answers
66 views

Can't get Mathematica to Import PDF files with diacritics on the file name

Tested with versions 9.0.0, 10.0.2 and 10.3.0, all under OS X 10.10.5. and Linux The ...
4
votes
1answer
95 views

depository/repository of Mathematica notebooks

Is there a depository/repository of Mathematica notebooks (not necessarily Mathematica packages) where one can upload some of their notebooks so as others can access them easily?
2
votes
3answers
70 views

How to make a list (of data points) whose name is the same as the file name from which the data is imported [duplicate]

I have a set of files, e.g. file1.dat, file2.dat,... containing data (list of data points to plot, manipulate...) I want to do the following ...
2
votes
2answers
76 views

How to separate the double columns while reading file

I have a file which has contents of the form 10533 "MENDOZAT " 115.0000 : 1 1.00000 Now I want to separate the words and get it as a list. like ...
0
votes
1answer
74 views

How to zip a folder? [duplicate]

This straightforward approach doesn't seem to work: In[42]:= cmd = StringSplit@"zip -r ~/data.zip ~/test/*" In[43]:= RunProcess@cmd Related: How can I ...
1
vote
1answer
41 views

Select folder with ChoiceDialog and return deepest folder name

For selecting a folder which contains data files I use the following code: ChoiceDialog[{FileNameSetter[Dynamic[dir], "Directory"], Dynamic[dir]}]; ...
1
vote
2answers
76 views

How to set the relative directory so that they work both in script and in notebook and portable?

Maybe the question is not clear, here I try to state it in more detail: I have a folder named project, for instance. In it I have two folders, one is named ...
1
vote
2answers
84 views

How do I set Mathematica to open a specific folder - When I type “Command + O” in OS X [closed]

When I type "Command + O", in Mac OSX 10, Mathematica automatically opens my directory: "Users/john" How can I change this setting to make it open "Users/john/Documents/Mathematica/GameOfLife" the ...
4
votes
3answers
175 views

How do I copy files to the clipboard?

Is there a way to mimic the Ctrl + V for a given file? I've got Mathematica to locate a certain file path, but I don't bother to copy the file in File Explorer (I will do this many times).
11
votes
2answers
3k views

How to place cdf file in Microsoft Word, Powerpoint or in interactive PDF file?

I would like to create a presentation for my lecture in which I would use Mathematica CDF files. Let's say I want to have such interactive content: ...
1
vote
1answer
58 views

How to export a list of numerical data to a file in the terminal?

I have a very simple program that export a list to a data file in table form. ...
10
votes
4answers
282 views

Handy / flexible directory tree operations

Is there any shorter / more handy / more flexible way to get directory tree as a nested Rules/Associations list? I tried to incorporate ...
6
votes
1answer
73 views

How do I directly read the Nth byte from a binary file?

I have a very large binary file (several hundred GB) which I would like to process using Mathematica. I only need to process a few bytes of this file at a time, and I know in advance which bytes I ...
1
vote
1answer
93 views

Using ReadList to import specific arrays of a multi-dimensional variable

Consider a large numerical variable (almost 1GB) which was constructed like below: output={scalar1,{Matrix1,Matrix2,Matrix3,scalar2}}; I used ...
1
vote
0answers
94 views

SemanticImport::unexpinvaliderr error when using trial version

I am trying to use SemanticImport for a personal experiment. I can correctly import a tsv file from a path, but if I change ...
2
votes
1answer
53 views

Get (<<) Evaluate File Name

This seems like a simple question due to lack of experience, but I can't seem to find an answer through searching. I am trying to read back a symbol from a ...
0
votes
0answers
85 views

Setting UserBaseDirectory for custom packages

Is there any reason to set $UserBaseDirectory to be anything other than the default? On my mac its set as ...
22
votes
0answers
417 views

A documented syntax of FileNames doesn't work?

Documentation discrepancy present through 10.3 According to the documentation for FileNames under Details: However when I attempt to use this syntax I get an ...
0
votes
1answer
75 views

How to fix backup command?

The following old code, from "Dr Bob" and Selwyn Hollis with a minor modification by me, produces a palette that allows one to create successive backups to the input notebook. But the code breaks in ...
2
votes
1answer
54 views

Where is ExampleData stored on my system

When I enter: Import["ExampleData/numberdata.csv"] Where does Mathematica go on my system to find the file numberdata.csv? Or, what Mathematica command will ...