mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.8K
active users

#awk

2 posts2 participants0 posts today

I am in urgent job search mode, so I'm gonna throw this out here and see if anything comes of it.

I am a #Canadian, fluent in both #English and #French. I have experience with several programming languages. My strongest proficiency is with #Haskell and #C. I also have a reasonable grasp of #HTML, #JavaScript, #SQL, #Python, #Lua, #Linux system administration, #bash scripting, #Perl, #AWK, some #Lisp (common, scheme, and emacs), and probably several others I've forgotten to mention.

I am not necessarily looking for something in tech. I just need something stable. I have done everything from software development, to customer support, to factory work, though my current circumstances make in-person work more difficult than remote work. I have been regarded as a hard worker in every job I have ever held.

I found a bug in my #awk AI bot that ended up blacklisting to many IPs. Because of a variable I thought would be initialized but turned out to be containing a previous value. I fear that this makes me a developer. A poor one, but one still.

Replied in thread

@ics

For me, it was during a lull in my workload at the #IBM Hursley lab in the UK when I worked my way through the O'Reilly #sed & #awk book (the one with the two lorises on the cover).

I'm guessing it was 1995 because my annual birdwatching summary at the start of the next year switched from a fixed column text document to formatting in #Postscript. My first big awk project was to process the underlying data to generate a PS document (something I also learned in the same downtime period).

Doing some table generation in awk, and is there an easier way to do "all fields n to NF" than this?

function combine(combn, combs) {
for (; combn<=NF; ++combn) {
combs=combs "\t" $(combn)
}
return combs
}

I could use printf on the fragments, but the annoyance is that loop, instead of
(string-join (cddr fields) "\t")
or whatever.

Ich habe hier 200 Text-Dateien, jeweils ca. 110 Megabyte, über 1,6 Millionen Zeilen.

Die erste Spalte soll fortlaufende Zahlen enthalten.

for F in $(ls stream_*.txt); do echo -en "$F\t"; awk 'NR==1{n=$1-1;}{print $1-NR-n;}' $F | uniq -c; done

Schleife über alle Dateien mit Namen stream_*.txt:
– gib Dateinamen aus,
– ziehe Zeilennummer und (ersterWert-1) von erster Spalte ab,
– zähle, wie häufig "0" oder etwas anderes rauskommt.

Ergebnis: alles in Ordnung ✅ 🥳

#Linux #AWK #CLI @climagic

Der #FPGA lief gut durch, ∃ Logdatei mit 29.385.185 Zeilen.

Die erste Spalte soll einfach nur hochzählen (wenn Zahlen fehlen = Fehler).

awk '{print $1-NR;}' tomotrg25.log | sort -n | uniq -c

… zieht von der Zahl in der ersten Spalte ($1) die Zeilennummer (NR = number of records) ab, dann wird sortiert, dann werden identische Zeilen zusammengefasst/gezählt.

Weil die Werte tatsächlich aufsteigend sind: $1-NR = const und diese Konstante kommt 29385185 mal vor 🥳

#Linux#awk#sort

If you want to run a #Linux command, displaying only the header line and lines which match a pattern, you can turn to #awk

Example:

sudo ss -tlunp | awk 'NR == 1 { print; } /dnsmasq/ { print; }' | less -NSiRJ

Replied in thread

... Odd that "#awk" complaints about newline in the first case💩 ...

#!/bin/sh

AWK='/usr/bin/awk'

uname -rKp
"$AWK" --version

input="9
9"

echo | "$AWK" -v arg="$input" '
{ print arg;
if ( arg ~ /^[0-9]+$/ ) { print ":ok" }
}'

echo | "$AWK" -v arg="9\n 9" '
{ print arg;
if ( arg ~ /^[0-9]+$/ ) { print ":ok" }
}'

14.2-RELEASE-p1 amd64 1402000
awk version 20240422
/usr/bin/awk: newline in string 9
9... at source line 1
9
9