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

3
votes
1answer
27 views

How to use Write[stream, expression] without automatic addition of next line character

I am writing a C code for solving a big set of differential equations. I am trying to use Mathematica to export some of the long expressions to C. I would like to know how I could use Write[stream, ...
3
votes
1answer
67 views

Can I get a list of more than fifteen of the most recent notebooks opened?

When I go to the pull-down options for “File”, one of them is “Open Recent”. It lists the last 15 notebooks opened. Is their any procedure to follow to get more (than 15) of the latest opened ...
2
votes
2answers
78 views

Generating a list of file names

I have set of files in the format 20160615-1-0.asc, 20160615-2-0.asc,... 20160615-5-0.asc etc. The following commands can List the file names at once which can be used to import later. ...
3
votes
1answer
57 views

Get n filenames in a directory?

I have a single flat directory with over a million files. I just wanted to take a sample of the first few files but FileNames doesn't include a "only the first n" ...
1
vote
0answers
39 views

How to Import file from subdirectory of ZIP file?

I have a "ZIP" file that contains directories. Import["arch.zip", "FileNames"] (* {"subdir\\test.txt"} *) However, ...
4
votes
0answers
32 views

How to specify drive name and network share in FileNameJoin

The benefit of FileNameJoin is that you don't need to worry about the operating system's formatting of directory paths. I need to specify a directory path to a ...
0
votes
0answers
23 views
6
votes
4answers
180 views

Searching a phrase in all *.nb files

I have so many *.nb files in a folder. In one of them I have written a phrase, unfortunately I cannot remember that file. I am searching about it and the file in ...
0
votes
1answer
35 views
2
votes
1answer
68 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
90 views

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
1answer
87 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 00:...
1
vote
0answers
66 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 ...
1
vote
1answer
84 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.
1
vote
2answers
90 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?
0
votes
0answers
63 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 ...
1
vote
2answers
48 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
292 views

How to make a better `Sort` in my case

I have some file names like this: ...
2
votes
0answers
54 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
62 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 ...
0
votes
1answer
42 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
53 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
71 views

How to batch convert a directory of images to thumbnails?

I have 50k images to resize, my first attempt at this was: ...
0
votes
1answer
68 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 ?
1
vote
1answer
48 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
91 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 ...
0
votes
1answer
27 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: ...
6
votes
0answers
100 views

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

Reply from WRI Support: [...] This indeed seems to be an issue with the Frontend on Windows and I have alerted the development team about this. Unfortunately I do not have a work around at ...
0
votes
0answers
61 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 ...
2
votes
3answers
71 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 ...
1
vote
1answer
42 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]}]; ...
0
votes
1answer
77 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 encrypt/...
4
votes
1answer
100 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?
1
vote
2answers
92 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 ...
4
votes
3answers
199 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).
1
vote
2answers
91 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 ...
1
vote
1answer
60 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. ...
6
votes
1answer
82 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 ...
2
votes
1answer
57 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 DumpSave:...
5
votes
2answers
74 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 ...
2
votes
1answer
66 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 ...
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 ...
6
votes
0answers
73 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 drag-...
1
vote
1answer
75 views

Moving files around

In order to introduce some order into the chaos, I want to move all pdf files on some big directory, say, "U:\", into a library directory, say: "U:\Library". So I get a list all files situated ...
29
votes
1answer
527 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
0answers
36 views

How to test if Import was successful? [duplicate]

I am importing and processing a bunch of files. Sometimes, for whatever reason, some of these files are not successfully imported so I'm looking for a way to Abort ...
12
votes
1answer
147 views

Path Names Longer Then 256 on Windows

Is there a way to work with pathnames that are longer then the typical 256 in Mathematica? For example run the following in Cygwin ...
8
votes
2answers
474 views

Case Sensitive File Names Windows(POSIX)

Is there an undocumented way to work with case sensitive files in Windows(If not is this a bug - it doesn't appear to match OSX or Linux behavior)? First enable case sensitivity in Windows. Then ...
1
vote
1answer
99 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 ...
3
votes
1answer
137 views

SetDirectory has problems when path is long and contains too many “_” [closed]

The following example code does not work (error: "Cannot set current directory ..."). I am running Mathematica 10.2.0.0 on Windows 10. ...