Line By Line is a NodeJS module that helps you reading large text files, line by line, without buffering the files into memory.
Questions tagged [line-by-line]
114 questions
4
votes
1 answer
Print variable line by line with string in front Python 2.7
I am writing a recon tool in Python and I've run into a bit of a problem trying to print a string in front of a multiple line variable without editing the string itself
Here is my sliver of code:
# ...
query1 = commands.getoutput("ls -1…

R3C0Nx00
- 129
- 1
- 1
- 9
4
votes
3 answers
std::thread - read from file line by line
I would like to read in parallel line by line from output file. Every thread read one line then work with data. In the mean time next thread have to read the next line.
std::ifstream infile("test.txt");
std::mutex mtx;
void read(int id_thread){
…

dropky
- 157
- 1
- 2
- 7
3
votes
1 answer
How to put remove certain line breaks in a file
I have a file which contains about 70,000 records which is structured roughly like this:
01499 1000642 4520101000900000
...more…

screen12345
- 117
- 1
- 6
3
votes
1 answer
Reading from a file C++ (Line by line - mixed variables)
Coding newbie here. C++ is my first language. Please include some explanation if possible.
I have to read lines from a file containing mixed variables. I am currently facing 2 issues:
Looping the input statements so that I can read all lines. I am…

gboyn
- 71
- 7
3
votes
2 answers
What's the meaning of dotTrace's numbers in Line-By-Line profiling?
What do those numbers mean exactly? Times the line was hit? Microseconds per invocation? Or what?
Also, what do the 'progress-bars' behind the numbers mean? They aren't even proportional to the numbers, so I'm really confused.

Stefan Monov
- 11,332
- 10
- 63
- 120
3
votes
1 answer
How do I have bash "eat" indentation characters common to all lines in a string?
I have some multi-line string in a shell variable. All lines of the string have an unknown indentation level of at least a few white-space characters (8 spaces in my example, but can be arbitrary). Let's look at this example string for instance:
…

con-f-use
- 3,772
- 5
- 39
- 60
3
votes
2 answers
reading from stdin, while consuming no more memory than needed
I am trying to create a line-by-line filter in python. However, stdin.readlines() reads all lines in before starting to process, and python runs out of memory (MemoryError).
How can I have just one line in memory at a time?
The kind of code I…

xtofl
- 40,723
- 12
- 105
- 192
3
votes
1 answer
Read output line by line in python
hi i want to make ssh connection and parse some datas. Im using paramiko and here is part of my code:
ssh=ssh_pre.invoke_shell()
ssh.send("display ospf peer brief \n")
output = ssh.recv(10000)
everything work until this…

zeto
- 53
- 2
- 7
3
votes
1 answer
python subprocess store each line of output in a list
I'm trying to store the dimensions of video files in a folder into a list.
#!/usr/bin/env python
# src_dimensions.py
# requires mediainfo package
import subprocess
proc = subprocess.Popen('mediainfo --Inform="Video;%Width%x%Height%\n"…

koogee
- 943
- 3
- 12
- 24
2
votes
2 answers
XSLT take line by line from the text of some element
I'd like to ask if there is any way in XSLT to take line by line of text in some element and apply something to that line. For example i have
Volume in drive C is SYSTEM Serial number is 2350:717C
Directory of C:\
10/17/97 …

klodye
- 93
- 1
- 4
- 11
2
votes
0 answers
R code executes when run line by line but not all at once
I am trying to read multiple lines in from a TCP web socket. When I run the following lines one at a time in the RStudio console, I get the data in the expected values and format. When I try to run them together (as part of a larger script or simply…

srs025
- 88
- 5
2
votes
0 answers
Reading a Non-Blocking java.nio SocketChannel Line-by-Line
I'm working on a Server which will have to hold hundreds pending tcp-connections, each of which only rarely transmits/receives actual data. I'd prefer doing this with non-blocking / selector based java.nio sockets rather then having hundreds of…

Peter Körner
- 101
- 8
2
votes
3 answers
how can a find a patter of numbers in consecutive lines with python?
Im learning python but i have some problems with my scripts yet.
I have a file similar to:
1 5
2 5
3 5
4 2
5 1
6 7
7 7
8 8
I want to print the pairs of numbers 2-1 in consecutive lines, just taking the column 2 to find them, and then, print the…

Hdez
- 151
- 7
2
votes
1 answer
Loading an image line by line Java
So this is going to sound ridiculous but I am working on a project where I deliberately want to slow down the loading of an image down so that it loads line by line. Is there anyway I can do this? I currently have the image in an ImagePane which…

SDSMTKyzer
- 112
- 10
2
votes
1 answer
R: Code works line by line but not implemented as a function
I have a data set (called 'data' here) which contains three important kinds of columns: A 'label' column, which corresponds to a list of institutions; a 'group' column that states to which group each institution belongs, and a series of 'measure'…

Jordan Taylor
- 23
- 4