Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

line-by-line

Bash: read a file line-by-line and process each segment as parameters to other prog

August 23, 2023 by Tarik

You can simplify this a lot: while read file key log lat do echo “$cmd” “$key” “$log” “$lat” “$file” done < “$input”

Categories bash Tags bash, line-by-line, parameters Leave a comment

How to read a CSV file from a stream and process each line as it is written?

June 9, 2023 by Tarik

As it says in the documentation, In order to make a for loop the most efficient way of looping over the lines of a file (a very common operation), the next() method uses a hidden read-ahead buffer. And you can see by looking at the implementation of the csv module (line 784) that csv.reader calls … Read more

Categories python Tags csv, line-by-line, python, stream Leave a comment

How can I profile Python code line-by-line?

November 14, 2022 by Tarik

I believe that’s what Robert Kern’s line_profiler is intended for. From the link: File: pystone.py Function: Proc2 at line 149 Total time: 0.606656 s Line # Hits Time Per Hit % Time Line Contents ============================================================== 149 @profile 150 def Proc2(IntParIO): 151 50000 82003 1.6 13.5 IntLoc = IntParIO + 10 152 50000 63162 1.3 10.4 … Read more

Categories python Tags line-by-line, profiling, python Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa