Questions tagged [readline]
A library for command line editing, or a function to read one line of text.
2,148
questions
0
votes
1
answer
20
views
NodeJS, I am trying to get an input line of integers using "readline", but getting TypeError: Cannot read property 'split' of undefined
Here is my program. It gives an error TypeError: Cannot read property 'split' of undefined. It should get 4 integers in 1 line and the give the output as one integer. The specifics of the output are ...
0
votes
0
answers
28
views
readline key bindings don't work properly in the default shell in Debian EC2 instance
I created a Debian EC2 instance. After I ssh into it, the default bash shell is strange to me.
When I type in a command and want to edit the command before running it,
moving left arrow key doesn't ...
2
votes
1
answer
45
views
Take multiple inputs from user using readline in Node. Where do I call the function?
I'm a complete beginner. So, here on Stack Overflow I found this solution of "How to take multiple input using readline, but I can't find how to apply this the function. I put it in the main ...
0
votes
2
answers
21
views
PHP readline produces scandir
I've noticed strange behavior from readline while using it for user input from a CLI.
When I press multiple tabs it prints a scandir to the input stream.
Below is the code:
$msg = "";
while (...
2
votes
1
answer
54
views
In my C# app. I am reading the CNC program of a remote machine into a byte buffer. How can I read this byte buffer line by line in to a string array?
I can read the complete CNC program of a remote machine to a byte buffer with a third party dll. After that I have to read the byte buffer line by line and transfer it to a string array.(I don't want ...
1
vote
1
answer
43
views
Calling readline() makes errno 2 in C. Does anyone know about this?
While testing my code, I have found out readline makes errno 2. This is ENOENT which means No such file or directory.
Does anyone know why??
#include <readline/readline.h>
#include <stdio.h&...
0
votes
1
answer
22
views
libreadline - fgetc returns different values for the enter key
fgetc returns a different value for the enter key after
calling libreadline's rl_callback_handler_install(). It changes from line feed (\n) to carriage return (\r).
How is this possible? I've read the ...
0
votes
1
answer
38
views
readline does not install [mac]
My Mac updated recently and I noticed that readline functionality was missing in Python. I tried to reinstall it and got a cryptic error, which I cannot decode. I have already uninstalled and ...
1
vote
0
answers
33
views
os.popen().readlines() showing permission denied
I am trying to use os.popen("command").readlines() but there are some paths where I don't have access and code is printing for that path "permission denied" .
I want to use the ...
0
votes
2
answers
42
views
read a text file with python with /t /n [duplicate]
I have a text file for exemple:
1 2 3
4 5 6 7
8 9
I want to get the output [1, 2, 3], [4, 5, 6, 7], [8, 9].
I tried the following code:
with open('name_file.txt', 'r') as f:
text=f.readlines()
...
0
votes
1
answer
39
views
How to input null or EOF in kotlin using readline
I'm doing beginner level Kotlin and I'm trying to do a multi line input and I found this code:
var originalTexts: MutableList<String> = mutableListOf()
while (true) {
val originalText = ...
0
votes
1
answer
57
views
Pandas: read_csv() method: string length limit
I have a file with millions of lines (26Gb).
But the second line has 23,000,000 of b'\x00' symbols (NUL).
When I read from a file into DataFrame it fails to read the second line, so I received only ...
-2
votes
0
answers
32
views
GNU Readline: feeding characters from socket
I have a telnet server app which shows a prompt and reads commands in lines, accepting characters received to the socket. (It's a Qt app, so characters arrive at a slot notified that chars are ...
-4
votes
1
answer
57
views
File.ReadLines().ToArray() and File.ReadAllLines() difference?
Hi I was searching for the difference File.ReadLines() and File.ReadAllLines() and found the question below.
What is the difference between File.ReadLines() and File.ReadAllLines()?
Isn't it the same ...
0
votes
3
answers
50
views
How can I utilize File.ReadLines instead of File.ReadAllLines in C# for this purpose
Hi I am trying to make a program which ; takes an input txt file then shows its lines in reverse order
I was using File.ReadAllLines so I get a array of strings then I used indexes of the strings and ...
0
votes
0
answers
14
views
sqlite3's command history breaks multi-line commands
When I use sqlite3's command history (i.e. arrow-up) after a multi-line command, I only get the last line of the previous command. Pressing arrow-up again, i get the second-last and so on. This seems ...
2
votes
1
answer
17
views
How to get variable from input NodeJs
I want to get a value from input
const readline = require('node:readline/promises').createInterface({
input: process.stdin,
output: process.stdout
})
const value = await readline.question('...
0
votes
1
answer
38
views
Getting error: Cannot implicitly convert type 'string' to 'int'
I'm new to coding. I am trying to improve myself by making simple coding. I just encountered such error while writing a code to retrieve data from user.
using System;
using System.Collections.Generic;
...
0
votes
0
answers
54
views
readline() with dictionary or regex
Below is the sample of data :
-----------------------------------------------------------------------------------------------------------------------
11:24:31 07/05/2022 --------------...
0
votes
0
answers
17
views
`readline` works asynchronously; how can I synchronously parse a file to return the result to global scope? [duplicate]
I need to parse a very large text file line by line, apply some text manipulation to it, .replace() etc. then populate these results into an array by index.
I need this to be returned to the global ...
2
votes
1
answer
35
views
What signal is emitted when pressing CTRL+D in node:readline?
I've been trying to intercept CTRL+D so I can use it to represent 'document' for a CLI I am building. I have been unsuccessful identifying how to intercept it when using readline with keypress.
Is ...
0
votes
1
answer
36
views
I have got error in my simple kotlin calculator
When I run this code, I have a problem. I want to build a simple calculator, so I need to use readLine() but I face error in subtraction, multiplication and division operations. This is the code, ...
0
votes
0
answers
11
views
How to continue accepting readline input after a 'close' event
I am trying to use readline to accept multiline input, which works, but the only way I have been able to do this is by using rl.close() and the 'close' event.
After I pass in ctrl-d or the ~ character,...
0
votes
0
answers
35
views
How to read from remote URL line by line
I am using the service, that exports the bulk of data in JSONL format on the remote URL address. It can be a big file, so I want to read from it line by line to avoid memory issues. Additionally, it ...
1
vote
1
answer
51
views
IntelliJ Throws error fatal: 'origin' does not appear to be a git repository. Trying to install a module with go get
I am trying to install [Prometheus][1] on my GO project using the following command inside my intelliJ terminal:
go get github.com/prometheus/client_golang/prometheus
and when I do so I am getting ...
0
votes
2
answers
27
views
RunTime Error when trying to take String input using readLine in Kotlin
I am a beginner in kotlin and this is the code I tried to execute, but runtime error is being displayed. Please help me resolve this.
import java.util.*
fun main(args: Array<String>)
{
var ...
0
votes
0
answers
31
views
How to define the control sequence sent by CTRL-Delete if it is unknown so far?
I am using bash connected through SSH to a server that I do not control, and since I didn't have the bindings for CTRL-Backspace to delete the word to the left, and CTRL-Delete to delete the word to ...
-1
votes
1
answer
44
views
Cannot compile PHP statically when adding `--with-readline`
I compiled php 8.1.7 statically in Alpine Linux latest version, and I made it with following command.
./configure LDFLAGS=-static --disable-all --enable-cli --enable-mbstring --enable-static=yes
sed -...
-2
votes
1
answer
78
views
rxvt-unicode does not accept Ctrl-F to move the cursor to next letter for Bash and GNU readline and other shells
Am using i3 window manager, rxvt-unicode 9.26, bash 5.1.16, and yash 2.52.
Already on set -o emacs mode.
Using ~/.Xresources file:
!! ~/.Xresources
!!
!! rxvt-unicode (urxvt)
!!
URxvt.geometry: ...
0
votes
1
answer
45
views
How to knit rmd to HTML from console?
In my rmarkdown I use readline() and write.xlsx(), after running the all chunks next I want to knit/produce HTLM file.
So I wonder if it's possible to put a specific code in the end, in order to run ...
-1
votes
1
answer
27
views
What is readline in node JS?
what is readline in NodeJS I don't known about it but I see many online test platform use readline please explain what is it
readline
0
votes
0
answers
28
views
Nodejs readline.question not working as expected in an imported function
I am trying to use readline.question in a function in a module that will be imported either from node console or from another module. When I do this, I am getting some weird behavior.
I don't know if ...
1
vote
0
answers
31
views
Is there a way to add to a file and read it to run different scripts?
I would like to know if there is a way to use a .txt file and write numbers (0-9) after running a script. After each script execution the script would read the file and determine what other script to ...
0
votes
1
answer
77
views
Kattis - readline [closed]
I'm trying to solve a task on Kattis. But I can't understand how to use readline. Am I totally wrong or am I close to solving it?
const readline = require('readline');
const rl = readline....
0
votes
1
answer
32
views
How to create a class instance using the CLI in TypeScript?
Is it possible to create a class instance using the Command Line/CLI in TypeScript?
// Machine.ts
export class Machine {
public model: string;
public height: number;
public width: number;
...
-1
votes
1
answer
60
views
ReadLine (Buffered reader) does not work in a loop [duplicate]
I'm writing code in Intelij. readLine does not correctly read the input (puts a line break at the end of the line), which is why the next readline does not work (becomes automatically empty).
Code:
...
0
votes
4
answers
74
views
Remove certian character from line by reading a file and save it to the file
I have a problem. I have a corrupted csv file. The last column is a free text and my seperator is ; unfortunately some users use ; in the free text, e.g. This is a longer text and;ups that should not ...
0
votes
1
answer
81
views
python - read from file and assign into multiple lists
How do I make the code so it reads the file and splits it so that it can assign which lines I specify into a certain named list.
I want the first 3 lines to be assigned into a list then the next 3 and ...
0
votes
0
answers
15
views
Is there a buffer when one uses the 'readline()' method? Can i access previously 'read/accessed' lines of txt? [duplicate]
Suppose I had opened to read a text file under name fileOpened, and it has the following lines:
line1
line2
line3
line4
If I execute fileOpened.readline() once, the output will be: 'line1'.
If I ...
0
votes
2
answers
272
views
Laravel tinker won't start because of a missing Termfile?
I've just tried to start tinker in my Laravel 8 project, I'm working on a Windows 10 PC with Mamp, I'm running PHP 7.4
When I run php artisan tinker I get an error:
Terminfo file does not exist
I've ...
0
votes
1
answer
15
views
R: how to let user to subset certain period of data through readline?
How can I lets user (in terminal) to chose certain period (e.g 2005-2009) from year column and subset data through this filter? using readline() and even also menu() functions
df <- data.frame (...
2
votes
1
answer
141
views
Kotlin readln() does not work as intended
If I assign values from readln() successively, they do not work properly; the second variable is an empty line.
fun main() {
val first = readln()
val second = readln()
println(first)
println(...
0
votes
0
answers
36
views
How to delete a line from a txt file without having to write again?
I have a very big txt file with uneven data lines. I want to delete a specific line from the txt file, but all methods shown in google shows to
Read the file to get all lines
Delete the specific line
...
0
votes
2
answers
144
views
Why is the second string returned from readLine() an empty string?
This is the code I used:
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in) );
String s1 = reader.readLine();
String s2 = reader.readLine();
String s3 = reader.readLine();
...
0
votes
1
answer
22
views
Read stream detect file changes (continue after file end)
I have trouble with a very simple task.
When i write to a file i want a read stream to be able to detect the newly written data to that file.
const fs = require("fs");
const read = fs....
0
votes
1
answer
44
views
BufferedReader.reader.readLine() returns nothing in Java
I have the following code:
Process pr = run.exec(sonarScannerCommand);
BufferedReader reader = new BufferedReader(new InputStreamReader(pr.getInputStream()));
BufferedReader eReader = new ...
0
votes
0
answers
30
views
readline createInterface is not a function when run client-side
Issue using readline
Setup
I am trying to use 'readline' package in a client-side dev setup, using watchify targeting a bundle.js file and python to create a server.
The module works fine with node....
-1
votes
2
answers
60
views
Empty list not appending
I am trying to get a list of positive words and negative words with my code but it keeps giving me an empty list. Also I'd like to know how to make my text all lowercase so it can properly append to ...
0
votes
0
answers
22
views
Change key-bindings for the GNU readline library
I am using the GNU readline c library for getting input from stdin. As I want the user to be able to input multiple lines (with line breaks) I don't want hitting enter to accept the line. Is there a ...
0
votes
0
answers
18
views
How to change from reading files to sys.stdin.readlines
How should I change the code if I want to change the file import to sys.stdin.readlines? I changed it several times and got different errors. Please I need some help.
f = open("p4.in", "...