Bash: read a file line-by-line and process each segment as parameters to other prog
You can simplify this a lot: while read file key log lat do echo “$cmd” “$key” “$log” “$lat” “$file” done < “$input”
You can simplify this a lot: while read file key log lat do echo “$cmd” “$key” “$log” “$lat” “$file” done < “$input”
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
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