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

file-processing

Splitting command line args with GNU parallel

May 16, 2023 by Tarik

You are probably looking for –colsep. generate_file_pairs | parallel –colsep ‘ ‘ ./prog {1} {2} Read man parallel for more. And watch the intro video if you have not already done so http://www.youtube.com/watch?v=OpaiGYxkSuQ

Categories bash Tags bash, file-processing, gnu-parallel Leave a comment

Randomly Pick Lines From a File Without Slurping It With Unix

April 25, 2023 by Tarik

if you have that many lines, are you sure you want exactly 1% or a statistical estimate would be enough? In that second case, just randomize at 1% at each line… awk ‘BEGIN {srand()} !/^$/ { if (rand() <= .01) print $0}’ If you’d like the header line plus a random sample of lines after, … Read more

Categories linux Tags awk, file-processing, linux, random, unix 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