Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
110 views

the problem is that awk transforms any roundable float into integers: 1.000 -> 1 for example: cat <<EOF | awk -v CONVFMT=%.06f '{$1=$1*2; print}' 0.000 some stuff 1.000 other different ...
cipper's user avatar
  • 319
Best practices
0 votes
4 replies
109 views

I came up with this: awk '{print}/SPECIAL_LINE/{exit}' file.txt | head -n -1 Any other suggestions? Maybe it could be more elegant. [UPDATE] Thank you very much everyone! I'd like to point out my ...
Signor Pizza's user avatar
2 votes
3 answers
305 views

I have a text file (data.txt) lala=something dada=somethingelse stuffwithoutequalsign otherstuffwithoutequalsign I am parsing it in R/Rstudio/Win11 using system call to awk (gawk 5.3.0 installed), ...
Suola's user avatar
  • 103
3 votes
6 answers
283 views

I would like to fuse a huge number of big (~1GiB) text files in VCF (Variant Call) Format. The operation requires to read all the headers first (in order to generate and output a new one) and then ...
Fravadona's user avatar
  • 17.8k
-4 votes
1 answer
98 views

I have a file with the following content: /opt: dev = /dev/hd10opt log = /dev/hd8 mount = true check = false /tmp: dev = /dev/hd10opt log = /dev/hd8 ...
Aires69's user avatar
  • 79
8 votes
7 answers
607 views

Here is the output of my curl command (print headers only): HTTP/1.1 200 OK Server: CacheHTTPd v1.0 Date: Thu, 08 Jan 2026 19:21:11 +0000 Content-Type: application/octet-stream Content-Length: ...
Ramesh's user avatar
  • 81
8 votes
4 answers
220 views

Given the following text: Param1 : Value1 Param2 : Value2 Param3 : Value3a : Value3b : Value3c Param4 : Value4 I would like to obtain the following Ansible result dict of strings or ...
CDuv's user avatar
  • 2,380
1 vote
2 answers
131 views

I have an input as the following. 0:4:1 untagged 192.168.20.11 255.255.255.0 0.0.0.0 0 0.0.0.0 3205 - 10 192.168.10.11 255.255.255.0 0.0.0.0 0 0.0.0.0 3205 - ...
GladiatorBobby's user avatar
Advice
1 vote
5 replies
65 views

I'm trying to get all the IP addresses with response 404's from our Apache web server log file. This is what I have: awk '($7 == "404") {print $1,$5}' /var/log/404.log | sort -n > ip.list ...
Aknot's user avatar
  • 519
Tooling
1 vote
3 replies
93 views

The idea of Persistent-Memory gawk is fabulous because it improves the performance, size, and clarity of many scripts on static and reference data. However, I have a significant problem in adopting ...
Sergio Albert's user avatar
6 votes
4 answers
246 views

I was working on a one-liner to subtract a constant value (e.g. 100 in this case) from a specific column using awk. So far I can manage to get to where I can print the last iteration only – which ...
Matteo's user avatar
  • 693
6 votes
3 answers
301 views

Most awk implementations I have tried (gawk, mawk, original-awk, bsd awk) allow the form: a || b = c The exception seems to be busybox which returns a syntax error unless parentheses are used: $ ...
jhnc's user avatar
  • 19.1k
6 votes
1 answer
166 views

I am looking for a way to write gawk scripts that can function both as standalone tools and function libraries that can be sourced in other scripts. The difference is in the BEGIN block that I intend ...
taprs's user avatar
  • 185
3 votes
3 answers
189 views

Essentially, I have a large FASTA file with over 100,000 transcripts in it, and I want to take the top 50 longest of those. After doing this: awk -vRS=">" -vORS="\n" -vFS="\...
deliza123's user avatar
1 vote
2 answers
166 views

this is a part of my bash script .. mytstamp=$(date '+%Y-%m-%d %H:%M:%S :: ') output=$(gawk -v mt="$mytstamp" -f print_errlog.awk errlog.txt) .. my file: <errlog.txt> 2025-10-11 14:25:...
cegthgtlhj's user avatar

15 30 50 per page
1
2 3 4 5
2294