Questions tagged [streams]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
46 views

Delete last line in an open OutputStream

I have Mathematica code that creates a file (more precisely, I use OpenWrite and create an OutputStream object) and I use ...
michelangelov's user avatar
1 vote
2 answers
54 views

ColorFunction for StreamPlot

I would like to color all lines witch have a positive vertical component in red and the other in blue. How can I do that? ...
Mark Smirnov's user avatar
0 votes
1 answer
34 views

Using Get with a few symbols to continue work in a later session [duplicate]

I have a notebook where I calculate integrals that take a long time to evaluate. Let's say that I assign each evaluation to a symbol: ...
tush's user avatar
  • 375
3 votes
0 answers
153 views

OpenRead with Method->"GZIP"

Aim I'm trying to "Low level" read data from a large "GZIP" file as an InputStream. Previous answeers I ...
Niels Walet's user avatar
3 votes
1 answer
107 views

Plotting phase plane in Filippov systems

I wanted to plot vector fields and nullclines for Modified Rosenzweig-MacArthur Model. and I have a problem plotting p1 and p2 in the same graph on top of each other(I want the vector fields arrows in ...
Doaa mahmoud's user avatar
0 votes
0 answers
140 views

How to extend length of the streams in this StreamPlot

Is it possible the force the streams in StreamPlot[] to extend the full range of the graphic given specific points of my choosing? For example, notice the streams for the following code are short. I ...
B flat's user avatar
  • 5,441
1 vote
1 answer
78 views

Wolframscript: Removing prepended message from Print in slave kernel

I am running a parallelized algorithm using WolframScript and inside the function being passed to the various kernels, I have print statements that track the computation and output the print ...
shanedrum's user avatar
  • 557
0 votes
0 answers
68 views

How to plot field line with exact starting and ending position continuously

As the title suggested, I want to plot the electric field lines with exact starting and ending position continuously. The code is like this: ...
Yue Yu's user avatar
  • 55
0 votes
2 answers
108 views

Memory preserving computation in chunks

I would like to do the following: Make a table tab1={{i1,b1,c1,d1},{i1,b1,c1,d2},...,{i1,b1,c2,d1},...,{i1,b2,c1,d1},...{i2,b1,c1,d1},...} for the given range imin < i < imax. Make some ...
John Taylor's user avatar
  • 4,642
2 votes
1 answer
50 views

How to read doubles from specific location of a large file

I have a 1GB file in a proprietary format that is a mix of ASCII characters and doubles (floating point numbers). I need to read in a sequence of twelve doubles. They are in consecutive bytes of the ...
Ted Ersek's user avatar
  • 6,984
3 votes
1 answer
84 views

How can I save the output from AudioRecord?

I'm trying to save a recording using AudioRecord. My recording gets overwritten even if I save the output in a fresh cell. This illustrates the issue: ...
fairflow's user avatar
  • 1,028
1 vote
0 answers
617 views

How to stream NSE option chain data into mathematica

I'm trying to stream option chain data into mathematica from the url: https://www.nseindia.com/api/option-chain-indices?symbol=BANKNIFTY ...
csk 7's user avatar
  • 403
3 votes
1 answer
144 views

How to get StreamPlots where the density of arrows adapted (discretization ) adapts to the presence of funnels, saddle-points, etc?

I want to draw a phase portrait where the density of arrows adapted (discretization ) adapts to the presence of funnels, saddle points, and other phenomena. For example, in the code attached, the aim ...
Rim ADENANE's user avatar
1 vote
2 answers
358 views

How to wait for new input from file InputStream

I'm trying to open a file to read and do some processing indefinitely until I decide to abort: ...
Dan Oak's user avatar
  • 628
1 vote
0 answers
97 views

Combine two streamplots with different position dependent color functions

Building from replies to other posts I have come up with a combination of two stream plots which has a position dependent color function for stream lines which the same for the two plots a way to &...
Ruth Lazkoz's user avatar
0 votes
1 answer
46 views

How can I make the vectors (vector heads) larger in a StreamPlot?

In my StreamPlots, the vectors can hardly be seen, in particular, since the heads of the vectors are so small. Can I change this? Example: ...
Scuderi's user avatar
  • 193
2 votes
1 answer
188 views

Phase portrait on the sphere

I have that $(x,y)\in S^1$, i.e. on the sphere, and in Mathematica, the ODE system ...
Scuderi's user avatar
  • 193
2 votes
2 answers
158 views

Converting Strings to Reals in a List

I am new to Mathematica and working with streamed data: ...
noob3000's user avatar
0 votes
1 answer
66 views

How to do computations with a specific column of a stream?

I'm trying to calculate the mean of a specific column of a huge dataset (given as .csv-file) using a stream in mathematica. I tried the following: ...
Sanny's user avatar
  • 45
3 votes
2 answers
153 views

How do I import a 1 gig text file by only importing the last 3 lines of every 10 line chunk?

I am trying to get the last three lines of every 10 line chunk into mathematica as a data variable. The text file has 3 columns. For example: ...
bandannadata's user avatar
2 votes
1 answer
70 views

StreamDensityPlot and its legends

I'm trying to plot this simple code ...
sined's user avatar
  • 573
1 vote
1 answer
132 views

write output to stream and also print it

I tried to save the Print[] output to a file using this code: ...
GM_jnj's user avatar
  • 121
2 votes
0 answers
82 views

How to read input stream with no newlines?

I have a script named stdout.wl: ...
kenkangxgwe's user avatar
4 votes
0 answers
31 views

Is there an equivalent to "Open Update"

I'm writing a binary file that contains a header followed by the data. The header contains the length of the data. The data is written first, skipping past the header. Once done, I would like to ...
Leon's user avatar
  • 41
3 votes
0 answers
179 views

Reading through file one line at a time, running out of RAM [closed]

I have a handful of files (some of which are very large), and I would like to loop through them one line at a time, run a calculation, and then write the result of the calculation to a new output file:...
Mark Hughes's user avatar
1 vote
0 answers
58 views

Issue with StreamDensityPlot

I'm plotting a complicated vector field that is yielding the following particular StreamDensityPlot. I'm using the following command to plot it: ...
sined's user avatar
  • 573
7 votes
1 answer
225 views

How do I reliably read from stdin using wolframscript?

I am trying to direct a stream of data to a wls script in a command line environment. Wolframscript provides the ...
Theelepel's user avatar
  • 328
2 votes
1 answer
250 views

Vector field Stream?

The following graph shows the vector plot. How can I plot the solid lines which represents how the vectors are spatially varying and both on the same graph (vector plot and stream field)? ...
a019's user avatar
  • 811
10 votes
1 answer
7k views

How to read a named pipe on Windows?

Tried to open an Out named pipe from Powershell ...
kenkangxgwe's user avatar
5 votes
0 answers
156 views

Optimize Use of PeakDetect in Mathematica

I am quite new to Mathematica and I am looking for some advice in order to improve and optimize my code. Here is what I am trying to do: Open a stream Read the stream line by line and store it in "...
etotheix's user avatar
  • 103
1 vote
2 answers
197 views

Reading CSV data from a stream [duplicate]

I'm trying to figure out how many rows/records my csv file has, which I have to stream because it's quite large. Can someone tell me if my approach works and how I can get it to loop through the ...
RechtigiLegände's user avatar
2 votes
0 answers
313 views

How to force Close of opened stream when stream write previously failed (bug in opening stream twice)?

I opened a stream like: str = OpenWrite[NotebookDirectory[] <> "myStream.tsv"]; and made an error when writing the first line (meant to be the tsv headers):...
user305883's user avatar
10 votes
2 answers
188 views

What is the fastest way to read the new lines in the dynamically updatable file?

I'm writing a log to a simple .txt file and want to read the last few records using Mathematica. But there are some problems. f = OpenRead["logs.txt"]; Skip[f, ConstantArray[Number, 2], 1]; Read[f, ...
Alexey Golyshev's user avatar
2 votes
1 answer
187 views

Streams in parallel kernels. Writing in multiple files in ParallelDo loop in Mathematica

I need to write data in multiple files in ParallelDo loop: ...
Karamveer Kaur's user avatar
2 votes
2 answers
70 views

Naming indexed output streams

I need to write into multiple files in a Do loop. Hence, I tried to open multiple streams: ...
Karamveer Kaur's user avatar
3 votes
2 answers
220 views

Join two datasets with a function similar to Vlookup [Big Dataset and Efficiency issue] - Wizards are welcome!

I am working on a huge dataset and I have a lot of data formatted in XML, we are talking about a couple of GBs. For this reason I am currently using the stream function to read them and extract the ...
Carmine Ragone's user avatar
2 votes
0 answers
101 views

Why does ReadString complain about the stream not being opened in binary format?

This works fine: ...
Szabolcs's user avatar
  • 233k
12 votes
0 answers
154 views

LibraryLink: How to read from a Mathematica stream in C?

Mathematica has a flexible streams interface. Functions like Read can read from a "stream" that may be backed by a file, pipe, string, network resource, etc. We can ...
Szabolcs's user avatar
  • 233k
3 votes
1 answer
331 views

How many records? In a file (streaming)

I want to know how many records a file (large data) contains... with streaming...like this: ...
Cécile Meier's user avatar
7 votes
0 answers
612 views

Communicating with server over Websocket using SocketConnect

I am trying to connect to a web socket feed of Gdax. The documentation is here, https://docs.gdax.com/#websocket-feed. There is no account needed and the information is public. I have successfully ...
Ray Troy's user avatar
  • 1,289
0 votes
0 answers
113 views

Is it possible to parallelize reading in Mathematica?

I have a gigantic data file that needs to be processed. I am reading it in chunks using ReadList with an InputStream. In my ...
Tofi's user avatar
  • 291
3 votes
2 answers
103 views

Explicitly control newline behaviour when writing strings with arbitary encoding

On Windows system, Mathematica by default opens stream which will automatically transform any "\n" into "\r\n". But I want pure ...
matheorem's user avatar
  • 16.9k
20 votes
1 answer
443 views

Is building an event-based parser possible/reasonable in Mathematica (WL)?

Too long? Go to Problems section Background I like to learn by doing small, sometimes artificial, projects. Among other things I had 'parsers', and 'stream methods / streams in MMA' on my to learn ...
Kuba's user avatar
  • 136k
5 votes
1 answer
657 views

Matrix Vector multiplication for very big matrices (>>RAM)

Problem Suppose a matrix-vector product of the form $M\vec{v}$ should be calculated where the amount of storage needed to store $M$ is noticeably larger than the available RAM on a machine. What is ...
pbx's user avatar
  • 842
1 vote
0 answers
36 views

How to export result from SQLResultSet into a csv

I have a sql query which produces very large data from a remote server but the data is too large to fit into memory all at once. So i want to read and export it sequentially into a csv. I am using the ...
user13892's user avatar
  • 9,113
1 vote
1 answer
39 views

Read not advancing StreamPosition [closed]

[MMA 11.0, Win7 64bit] I have a number of CVS files of ~1-2GB, millions of rows, so I want to read them in records, chunks building on Albert Retey's answer to this question I assumed, and the ...
Julian Moore's user avatar
  • 2,560
5 votes
0 answers
64 views

Why ReadList ignores NullRecords for Number?

When thinking on this recent question the immediately obvious solution which came to my mind was to use ReadList with options ...
Alexey Popkov's user avatar
6 votes
1 answer
261 views

Is there a way to redirect the output from `Echo`?

The newish function Echo is tremendously useful in quick-and-dirty debugging, since you can stick it pretty much anywhere in an expression and get feedback about ...
Pillsy's user avatar
  • 18.3k
3 votes
0 answers
37 views

Unexpected behaviour with WordSeparators and Read [duplicate]

I am confused about how Read separates elements. The following all work fine: ...
Szabolcs's user avatar
  • 233k
4 votes
1 answer
77 views

How to get the standard error stream for a ProcessObject?

When you run an external program using RunProcess, the program will run to completion and you will receive an association containing the exit code, stuff that went ...
Pillsy's user avatar
  • 18.3k