A source of input or output: files and pipes are both examples of general Mathematica objects known as streams.

learn more… | top users | synonyms

2
votes
1answer
53 views

Importing a Base64 encoded string

everyone, I'm handling some paragraphs enconded with Base64 from CSV file format. The problem is that Mathematica can't decode it. It seems Mathematica Encode/Decode their own Base64. I'm thinking ...
4
votes
4answers
90 views

How can I close a stream without knowing its name?

If I initialise a stream as follows OpenWrite["~/example"] How do I close this stream? Close seems to expect a name, but I ...
3
votes
1answer
76 views

CountryData et al. and associated InputStream

Quick update I found a way to solve this in webMathematica, using CollectStreams. But still, below problem leaves me puzzled, I would very much like to learn how ...
1
vote
0answers
49 views

Getting InputStream errors when including a call to ElementData within an Import definition

So I am writing an ImportExport converter for a common chemistry file format, and I've run up against a problem that seems to be about shared streams and whatnot. ...
2
votes
1answer
60 views

Followup question from "Temporarily redirect output of Print[ ] to a second file

I'm implementing the first answer to my earlier question about redirecting the output of Print[ ]. Opening a file with OpenWrite[] and assigning the stream to ...
5
votes
2answers
115 views

Short circuit logical operators [duplicate]

Suppose I want to compute $f(1)\vee f(2) \vee \ldots \vee f(10^{10})$, but I know a priori that $f(n)$ is True for some $n \ll 10^{10}$ with high probability. For ...
1
vote
0answers
99 views

Opening a pipe with OpenRead

My question is if it is possible to directly open a (named) pipe using OpenRead. Introduction In the docs of OpenRead, we have, under details and options, If ...
2
votes
1answer
105 views
3
votes
1answer
199 views

Write and Read to StreamPosition

One OutputStream and one InputStream are opened on the same file: ...
3
votes
0answers
68 views

Reading a specified line number from a text file [duplicate]

Possible Duplicate: How to read data file quickly? I have a huge text file (~500 MB). The file is too large to Import into Mathematica, although I can ...
3
votes
1answer
111 views

Directing output of PrintTemporary to an additional OutputStream

I want to log messages that I send to the screen, even temporary ones. By setting $Output appropriately, it is possible to log ...
4
votes
4answers
211 views
3
votes
1answer
162 views

Efficiently importing XPM matrix data into Mathematica

The XPM file format is an image file format. Although it is primarily intended for icon pixmaps, it can also be used to store matrix data. For example, the GROMACS chemical simulation package uses ...
3
votes
1answer
213 views

How to write output to an external text file in addition to the standard output stream?

How to write output to an external text file in addition to the standard output stream, i.e. a notebook for a session with FE and stdout for command-line session?
8
votes
2answers
198 views

How to record the stream of data (PixelPosition) dynamically?

I need to trace the moving of an object and get the coordinates of such movement. The set of coordinates will be used for the subsequent evaluation and analysis. I can easy get the current real-time ...
4
votes
1answer
557 views

Stream CSV files

Ram limitations make import impractical for large CSV files. Is it possible to Stream CSV correctly? ...
7
votes
1answer
184 views

How do I re-direct FilePrint's output?

I recently wanted to use FilePrint to print the contents somewhere else but in the notebook I was using. However, the obvious-seeming solution doesn't work at all: ...
3
votes
0answers
85 views

How do I direct output to a specific notebook or cell? [duplicate]

Possible Duplicate: How to pipe a stream to another notebook? Is there any way to create a stream so that all output to the stream (from Write or ...
10
votes
1answer
465 views

How to generate a real-time stream of data?

I'm experimenting with Inversion-of-Control (callback) programming patterns, and I would like a way to generate streams of data at specified real-time intervals. I came up with the illustrated way to ...
7
votes
3answers
425 views

Reading from a stream of strings and numbers delimited by commas

I am trying to read from a stream of strings and numbers delimited by commas similar to the way I have read from a stream of strings and numbers delimited by spaces. Example delimited by spaces ...
10
votes
2answers
681 views

Creating a realtime MIDI Out

I have a live stream of notes and note velocities using SoundNote and SoundVolume. My problem is that I have no idea how to ...
4
votes
1answer
487 views

Why these (error) messages?

Testing this answer I used: stream = OpenWrite["A:\\out.txt"]; Block[{$Messages = stream}, Mod[1, 2, 3, 4, 5] ] and I was surprised to find that the contents ...
10
votes
2answers
200 views

How to Write into multiple files?

Note: this is fixed in version 9. I want to put expressions into multiple files simultaneously, with the following code: ...
8
votes
1answer
332 views

How to pipe a stream to another notebook?

Can I pipe an OutputStream object created by OpenWrite (or similar) to a notebook instead of a file? I am aware that I can use ...