Questions tagged [awk]

The AWK utility is a data extraction and reporting tool that uses a data-driven scripting language consisting of a set of actions to be taken against textual data (either in files or data streams) for the purpose of producing formatted reports.

The AWK utility is a data extraction and reporting tool that uses a data-driven scripting language consisting of a set of actions to be taken against textual data (either in files or data streams) for the purpose of producing formatted reports. The language used by awk extensively uses the string datatype, associative arrays (that is, arrays indexed by key strings), and regular expressions.

AWK was created at Bell Labs in the 1970s, and its name is derived from the family names of its authors — Alfred Aho, Peter Weinberger, and Brian Kernighan.

195 questions
2
votes
2 answers

AWK help filter data into CSV

We are doing some security research for which I need to extract from Debian repos all available package names, versions, desc, etc. I'm trying to parse output of apt-cache dumpavail into CSV and organise data into tabular form like name, version,…
1
vote
1 answer

awk $1 and $2 variables coming up empty

GOAL : compare the size of our directory structure day over day. The data folder has over 990tb in it, so I had to run a bunch of parallel du's in order for it to finish in a reasonable amount of time. Occassionally we see large data growth very…
0
votes
4 answers

do... while loop in original 1978 awk?

Does the do... while loop work in the original awk? Or has it been introduced in later implementations (nawk, gawk, ...)? Can nawk be considered present on all Unix platforms today? Greets, Oliver
Trollhorn
0
votes
1 answer

Limit awk results to html requests

I'm using awk to analyze some access log files. I'm currently using the following: awk '($9 ~ /404/)' access_log | awk '{print $9,$7}' | sort | uniq -c | sort > 404.txt Which returns all of the 404s in my access log with number of appearances.…
Vecta
  • 103
0
votes
1 answer

within awk how to check for a defined value before attempting a calculation

The following awk line will fail when c15 is not defined or is 0. How to modify it so that in such cases it does not attempt the calculation, but instead provides an error message or does nothing: cat formatted.dsv | awk -F"\t" '{ c12 = $12; c15 =…
0
votes
1 answer

awk to process multiple lines and return several strings

I have these strings: Certificate Name: domain1.com Serial Number: 37aadb8fae7b908e1228c3e71 Domains: domain1.com www.domain1.com Expiry Date: 2022-11-20 02:14:29+00:00 (VALID: 3 days) Certificate Path:…