# \#input-output

**URL:** https://discourse.julialang.org/tag/input-output/300.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Redirect \`@time\` output into a string](https://discourse.julialang.org/t/redirect-time-output-into-a-string/124872)

<div class="topic-metadata">

**Author:** [@alex180500](https://discourse.julialang.org/u/alex180500)\
**Replies:** 2\
**Last updated:** [January 17, 2025, 1:47pm UTC](https://discourse.julialang.org/t/redirect-time-output-into-a-string/124872 "2025-01-17T13:47:53Z")

</div>

Hello! working in a for loop I want to time a long computation with @time and I want to output the stdout into a string (that i’m using later in the for loop). for \_ in 1:num\_loops @time myvar = longcomputation() en…

---

## [Save data to same files from independent, parallel processes](https://discourse.julialang.org/t/save-data-to-same-files-from-independent-parallel-processes/122876)

<div class="topic-metadata">

**Author:** [@J-J](https://discourse.julialang.org/u/J-J)\
**Replies:** 1\
**Last updated:** [November 21, 2024, 4:05pm UTC](https://discourse.julialang.org/t/save-data-to-same-files-from-independent-parallel-processes/122876 "2024-11-21T16:05:20Z")

</div>

Problem I have a Julia script which computes two numbers, num1 and num2, but the computation isn’t deterministic and so these computed numbers are different each time I run the script. Now I want to run this script many …

---

## [Ask user to provide points coordinates as two vectors or as a single vector of tuples?](https://discourse.julialang.org/t/ask-user-to-provide-points-coordinates-as-two-vectors-or-as-a-single-vector-of-tuples/117717)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 10\
**Last updated:** [August 2, 2024, 9:21pm UTC](https://discourse.julialang.org/t/ask-user-to-provide-points-coordinates-as-two-vectors-or-as-a-single-vector-of-tuples/117717 "2024-08-02T21:21:42Z")

</div>

When asking the user to provide coordinates of plan points for my package RingStarProblems.jl I initially thought the following was best: xycoordinates = tuple.(1:10, rand(1:10, 10)) somefunction(xycoordinates) However…

---

## [VSCode errors with user input readline()](https://discourse.julialang.org/t/vscode-errors-with-user-input-readline/75097)

<div class="topic-metadata">

**Author:** [@SebaSharma](https://discourse.julialang.org/u/SebaSharma)\
**Replies:** 5\
**Last updated:** [May 20, 2024, 2:40pm UTC](https://discourse.julialang.org/t/vscode-errors-with-user-input-readline/75097 "2024-05-20T14:40:22Z")

</div>

Hello, I hope you are all doing well I’ve really been enjoying Julia, and it’s been taking the place of Java in my focused language, but I’ve been having some problems with user inputs in VSCode (Vers. 1.63.2 on Windows…

---

## [Input data for main simulation with ParallelStencil.jl](https://discourse.julialang.org/t/input-data-for-main-simulation-with-parallelstencil-jl/105385)

<div class="topic-metadata">

**Author:** [@chloisu](https://discourse.julialang.org/u/chloisu)\
**Replies:** 3\
**Last updated:** [October 25, 2023, 7:38pm UTC](https://discourse.julialang.org/t/input-data-for-main-simulation-with-parallelstencil-jl/105385 "2023-10-25T19:38:16Z")

</div>

Hello, I have a question regarding the use of ParallelStencil.jl. I would like to initialize a simulation or load a previous solution and assign these input fields like temperature or so to the ParallelStencil Arrays be…

---

## [WIOD database in Julia](https://discourse.julialang.org/t/wiod-database-in-julia/100759)

<div class="topic-metadata">

**Author:** [@Guido](https://discourse.julialang.org/u/Guido)\
**Replies:** 3\
**Last updated:** [June 25, 2023, 4:08pm UTC](https://discourse.julialang.org/t/wiod-database-in-julia/100759 "2023-06-25T16:08:35Z")

</div>

I’m working on World Input-Output Database (WIOD) from Groningen. Usually, I work this data using STATA. What I have so far is my usual do file template translated in Julia language, but I want to do it in Julia from sc…

---

## [Glitch with readline() in VSCode?](https://discourse.julialang.org/t/glitch-with-readline-in-vscode/95550)

<div class="topic-metadata">

**Author:** [@Maddy](https://discourse.julialang.org/u/Maddy)\
**Replies:** 8\
**Last updated:** [March 6, 2023, 1:08pm UTC](https://discourse.julialang.org/t/glitch-with-readline-in-vscode/95550 "2023-03-06T13:08:41Z")

</div>

(Ignore the code I wrote… the glitch is about the REPL) The first time I input something for readline(), nothing happens. I have to enter my input again. And after the code is done running, a weird input not define…

---

## [How to Detect Key Down Events?](https://discourse.julialang.org/t/how-to-detect-key-down-events/95011)

<div class="topic-metadata">

**Author:** [@Maddy](https://discourse.julialang.org/u/Maddy)\
**Replies:** 5\
**Last updated:** [February 23, 2023, 5:36am UTC](https://discourse.julialang.org/t/how-to-detect-key-down-events/95011 "2023-02-23T05:36:39Z")

</div>

I want to detect key presses while my main program loop runs. Say I’m computing loads of data and printing that in the REPL. I want to be able to detect any keys I press. For example, if the key ‘p’ is pressed, all the c…

---

## [Very strange language choice for printing integer vs float arrays](https://discourse.julialang.org/t/very-strange-language-choice-for-printing-integer-vs-float-arrays/84945)

<div class="topic-metadata">

**Author:** [@singularity](https://discourse.julialang.org/u/singularity)\
**Replies:** 2\
**Last updated:** [July 28, 2022, 10:19pm UTC](https://discourse.julialang.org/t/very-strange-language-choice-for-printing-integer-vs-float-arrays/84945 "2022-07-28T22:19:38Z")

</div>

I find the following behavior of print statement quite strange. Let’s say I have an array of floating point numbers and I print it. That is, a = \[2.0, 3.0\] println(a) I get the following result upon executing the code…

---

## [\[ANN\] Joysticks.jl Version 0.1.3](https://discourse.julialang.org/t/ann-joysticks-jl-version-0-1-3/81749)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 0\
**Last updated:** [May 26, 2022, 10:40pm UTC](https://discourse.julialang.org/t/ann-joysticks-jl-version-0-1-3/81749 "2022-05-26T22:40:16Z")

</div>

Joystick interface for Julia This is the first version that is cross-platform and tested on Windows and Linux. It should also work on Mac, but I cannot test that (voluteers welcome). Compared to using the bare Joystic…

---

## [How to define input from users for a 2D heteregenous model](https://discourse.julialang.org/t/how-to-define-input-from-users-for-a-2d-heteregenous-model/79624)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 4\
**Last updated:** [April 18, 2022, 8:54pm UTC](https://discourse.julialang.org/t/how-to-define-input-from-users-for-a-2d-heteregenous-model/79624 "2022-04-18T20:54:01Z")

</div>

Hi everyone, I am working on a small modeling project. Let’s say I want to do 2D diffusion modeling in different units. All the units are homogeneous but they can have different geometries and physical properties. I wa…

---

## [Best practice to use lots of pre-allocated arrays in a function](https://discourse.julialang.org/t/best-practice-to-use-lots-of-pre-allocated-arrays-in-a-function/77353)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 7\
**Last updated:** [March 4, 2022, 12:32pm UTC](https://discourse.julialang.org/t/best-practice-to-use-lots-of-pre-allocated-arrays-in-a-function/77353 "2022-03-04T12:32:10Z")

</div>

I am still quite new to Julia, working on numerical modeling and I am starting to write a bigger project than usual. I have a function that takes, as arguments, lots of pre-allocated arrays and parameters and update the…

---

## [Reading and processing multiple very large Wav files](https://discourse.julialang.org/t/reading-and-processing-multiple-very-large-wav-files/27158)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 10\
**Last updated:** [February 22, 2022, 2:30am UTC](https://discourse.julialang.org/t/reading-and-processing-multiple-very-large-wav-files/27158 "2022-02-22T02:30:33Z")

</div>

New job, new problems! :slight\_smile: I’m currently trying to figure out the best way to read a folder of very large WAV sound files and process them. Reading an entire file causes me to run out of memory. Thankfully, t…

---

## [Print on a separate Blink window, or elsewhere than STOUT](https://discourse.julialang.org/t/print-on-a-separate-blink-window-or-elsewhere-than-stout/37014)

<div class="topic-metadata">

**Author:** [@Dario\_Sarra](https://discourse.julialang.org/u/Dario_Sarra)\
**Replies:** 0\
**Last updated:** [April 4, 2020, 12:07pm UTC](https://discourse.julialang.org/t/print-on-a-separate-blink-window-or-elsewhere-than-stout/37014 "2020-04-04T12:07:45Z")

</div>

I am writing UI using blink and Interact. I am fairly new to the use of tasks and CSS, so maybe my problem is actually fairly easy. During different operations, I use print to write messages such as “wait for…”, “all go…

---

## [How to work with type unstable functions?](https://discourse.julialang.org/t/how-to-work-with-type-unstable-functions/56389)

<div class="topic-metadata">

**Author:** [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Replies:** 2\
**Last updated:** [November 12, 2021, 3:47pm UTC](https://discourse.julialang.org/t/how-to-work-with-type-unstable-functions/56389 "2021-11-12T15:47:37Z")

</div>

The question is: consider that I have a function, which is by the nature of the problem should return a heterogeneous result. Is there any way, approach, or design ideas, how to build a workflow that can work with these …

---

## [\[ANN\] Scanf 0.3](https://discourse.julialang.org/t/ann-scanf-0-3/64216)

<div class="topic-metadata">

**Author:** [@klacru](https://discourse.julialang.org/u/klacru)\
**Replies:** 0\
**Last updated:** [July 7, 2021, 2:19pm UTC](https://discourse.julialang.org/t/ann-scanf-0-3/64216 "2021-07-07T14:19:44Z")

</div>

Scanf is the C-style of io-stream formatted reading. This version provides most features of standard scanf C function family. Scanf.jl example usage: julia\> using Scanf julia\> r, a, b, c, d = @scanf "42 -infABCDE he…

---

## [What recommended format of input parameters/options of a large hydrological model compiled as a Julia Package?](https://discourse.julialang.org/t/what-recommended-format-of-input-parameters-options-of-a-large-hydrological-model-compiled-as-a-julia-package/60561)

<div class="topic-metadata">

**Author:** [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Replies:** 2\
**Last updated:** [May 16, 2021, 10:59pm UTC](https://discourse.julialang.org/t/what-recommended-format-of-input-parameters-options-of-a-large-hydrological-model-compiled-as-a-julia-package/60561 "2021-05-16T22:59:55Z")

</div>

The question is what format (e.g. .csv, .txt etc…) would you recommend to read Inputs options/ parameters values of a large model https://github.com/manaakiwhenua/SoilWater\_ToolBox.git ? I was informed in Discourse that…

---

## [Read an existing txt file](https://discourse.julialang.org/t/read-an-existing-txt-file/60473)

<div class="topic-metadata">

**Author:** [@rahmani-hossein](https://discourse.julialang.org/u/rahmani-hossein)\
**Replies:** 2\
**Last updated:** [May 4, 2021, 8:03am UTC](https://discourse.julialang.org/t/read-an-existing-txt-file/60473 "2021-05-04T08:03:36Z")

</div>

I faced something strange when I create a file and writing sth(by hand) in it I can read it with readdlm and there isn’t any problem .but when I want to read an existed txt file on my desktop it says to me there isn’t an…

---

## [Saving output to txt/CSV file?](https://discourse.julialang.org/t/saving-output-to-txt-csv-file/59636)

<div class="topic-metadata">

**Author:** [@Bonjour-Lemonde](https://discourse.julialang.org/u/Bonjour-Lemonde)\
**Replies:** 2\
**Last updated:** [April 20, 2021, 5:47am UTC](https://discourse.julialang.org/t/saving-output-to-txt-csv-file/59636 "2021-04-20T05:47:25Z")

</div>

Hi guys, I am dealing with output saving, I have tried several ways referred to docs. But nothing works for me. The output I want to save look like this julia\> sim\_result GpABC.SimulatedABCRejectionOutput(3, 1465, 2000…

---

## [Save figures as pdf](https://discourse.julialang.org/t/save-figures-as-pdf/57503)

<div class="topic-metadata">

**Author:** [@Rasoul\_Jafarzadeh](https://discourse.julialang.org/u/Rasoul_Jafarzadeh)\
**Replies:** 4\
**Last updated:** [March 20, 2021, 7:33am UTC](https://discourse.julialang.org/t/save-figures-as-pdf/57503 "2021-03-20T07:33:02Z")

</div>

In my code, I have lots of figuers and I want them to save as pdf. I did it but all plots saved in one page. How can I save them in some pages?

---

## [Benchmarks of Various Formats for Tabular Data](https://discourse.julialang.org/t/benchmarks-of-various-formats-for-tabular-data/50489)

<div class="topic-metadata">

**Author:** [@lungben](https://discourse.julialang.org/u/lungben)\
**Replies:** 1\
**Last updated:** [November 21, 2020, 4:14am UTC](https://discourse.julialang.org/t/benchmarks-of-various-formats-for-tabular-data/50489 "2020-11-21T04:14:38Z")

</div>

Hi, here is a Pluto.jl notebook for benchmarking of the read and write performance, as well as file sizes of various formats for tabular data. The following formats / packages are compared: CSV via GitHub - JuliaDa…

---

## [Parsing arrays directly from text file](https://discourse.julialang.org/t/parsing-arrays-directly-from-text-file/49766)

<div class="topic-metadata">

**Author:** [@h2ster](https://discourse.julialang.org/u/h2ster)\
**Replies:** 2\
**Last updated:** [November 8, 2020, 3:19am UTC](https://discourse.julialang.org/t/parsing-arrays-directly-from-text-file/49766 "2020-11-08T03:19:13Z")

</div>

I’m currently working on a project where one of the functions generates a large amount of data and returns it as an vector, where each element of the vector is itself a vector with various levels of nesting. I use this d…

---

## [Saving vegalite plots takes very long time compared to plots.jl](https://discourse.julialang.org/t/saving-vegalite-plots-takes-very-long-time-compared-to-plots-jl/48232)

<div class="topic-metadata">

**Author:** [@MackHarry](https://discourse.julialang.org/u/MackHarry)\
**Replies:** 10\
**Last updated:** [October 12, 2020, 9:41pm UTC](https://discourse.julialang.org/t/saving-vegalite-plots-takes-very-long-time-compared-to-plots-jl/48232 "2020-10-12T21:41:31Z")

</div>

Hello everyone, first time poster here. I’m running into problems when trying to save vegalite plots as pdf, or anything other than html for that matter. The following script exemplifies this quite well: using VegaLit…

---

## [How to read a string from a file with interpolation](https://discourse.julialang.org/t/how-to-read-a-string-from-a-file-with-interpolation/47913)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 7\
**Last updated:** [October 7, 2020, 8:22pm UTC](https://discourse.julialang.org/t/how-to-read-a-string-from-a-file-with-interpolation/47913 "2020-10-07T20:22:02Z")

</div>

The file “test.txt” contains a single line: I am $me The following is intended to simply read the string and store the interpolated result in str: me = "Sam" str = read("test.txt", String); str == "I am Sam" false

---

## [How to wait on multiple file descriptors/streams](https://discourse.julialang.org/t/how-to-wait-on-multiple-file-descriptors-streams/46827)

<div class="topic-metadata">

**Author:** [@HanD](https://discourse.julialang.org/u/HanD)\
**Replies:** 0\
**Last updated:** [September 18, 2020, 7:42am UTC](https://discourse.julialang.org/t/how-to-wait-on-multiple-file-descriptors-streams/46827 "2020-09-18T07:42:41Z")

</div>

Hello all, I’m trying to read from multiple sockets/file descriptors, and would like to wait for either of them to have available bytes, then read them, and go back to waiting. In a regular posix system, I would use sel…

---

## [How to capture standard input from a piped command?](https://discourse.julialang.org/t/how-to-capture-standard-input-from-a-piped-command/39509)

<div class="topic-metadata">

**Author:** [@Marc\_Sevaux](https://discourse.julialang.org/u/Marc_Sevaux)\
**Replies:** 8\
**Last updated:** [May 18, 2020, 10:14pm UTC](https://discourse.julialang.org/t/how-to-capture-standard-input-from-a-piped-command/39509 "2020-05-18T22:14:37Z")

</div>

Apologizes if this has already been answered. I heavily use command line scripts and combination of piped commands to generate list of numbers that I want to “statistically” analyze by piping them to a julia script. To…

---

## [Function doesn't show result](https://discourse.julialang.org/t/function-doesnt-show-result/38027)

<div class="topic-metadata">

**Author:** [@Jul](https://discourse.julialang.org/u/Jul)\
**Replies:** 3\
**Last updated:** [April 23, 2020, 6:32am UTC](https://discourse.julialang.org/t/function-doesnt-show-result/38027 "2020-04-23T06:32:00Z")

</div>

Hello! I wrote little function but its not show output. I am fresh in this language and I’ve no idea why it’s not work. My input is : f(x-\>1) after that program freezes. This is function: function f(func=x^2) a\_lower …

---

## [Streaming gziped file to FASTQ.Reader - where to add method?](https://discourse.julialang.org/t/streaming-gziped-file-to-fastq-reader-where-to-add-method/36266)

<div class="topic-metadata">

**Author:** [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Replies:** 2\
**Last updated:** [March 20, 2020, 3:21pm UTC](https://discourse.julialang.org/t/streaming-gziped-file-to-fastq-reader-where-to-add-method/36266 "2020-03-20T15:21:15Z")

</div>

FASTQ is a file format used for DNA sequencing, and we have a handy reader in the FASTX package. using FASTX testfile = "some/path.fastq" for record in FASTQ.Reader(open(testfile)) seq = FASTQ.sequence(record) …

---

## [Getting user input like with Java's Scanner](https://discourse.julialang.org/t/getting-user-input-like-with-javas-scanner/34960)

<div class="topic-metadata">

**Author:** [@Lorenzo](https://discourse.julialang.org/u/Lorenzo)\
**Replies:** 12\
**Last updated:** [February 21, 2020, 6:24pm UTC](https://discourse.julialang.org/t/getting-user-input-like-with-javas-scanner/34960 "2020-02-21T18:24:41Z")

</div>

Hi guys, this is my first post with a super-newbie question I’d like to ask: As you may have noticed, I’m new to Julia and I have been coding with Java for a year. I’d like to get user-input just like in Java but I’m s…

---

## [Standard methods for input stream from console, serveing for OJ practice](https://discourse.julialang.org/t/standard-methods-for-input-stream-from-console-serveing-for-oj-practice/32329)

<div class="topic-metadata">

**Author:** [@LibraNeptune](https://discourse.julialang.org/u/LibraNeptune)\
**Replies:** 0\
**Last updated:** [December 16, 2019, 10:54am UTC](https://discourse.julialang.org/t/standard-methods-for-input-stream-from-console-serveing-for-oj-practice/32329 "2019-12-16T10:54:15Z")

</div>

Several types: Single-digit of numeric value input One-by-one numeric values input \[numeric array, split by blank\] Multiple lines of numeric values or component input mixed with strings Large-scale data input All the…

[Next page](https://discourse.julialang.org/tag/input-output/300.md?match_all_tags=true&page=1&tags%5B%5D=input-output)
