bolha.us is one of the many independent Mastodon servers you can use to participate in the fediverse.
We're a Brazilian IT Community. We love IT/DevOps/Cloud, but we also love to talk about life, the universe, and more. | Nós somos uma comunidade de TI Brasileira, gostamos de Dev/DevOps/Cloud e mais!

Server stats:

252
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.

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

hey you AI, help me to create this #AWK script...
forget it, I can do it by myself.
#bash? same thing...
you have much better results with #python or others, but definetly you are in trouble if you do not understand how to do it or troubleshoot it (which can take longer than just do it)

Je viens d'arriver à écrire un script shell en une ligne de awk pour un projet Kirby bilingue où je dois formater des gros fichiers .txt exportés depuis un tableau de traduction sous forme de tableaux PHP indentés correctement, et ça me rend heureux :

`awk -F$'\t*' '{gsub(/[ \t]+$/,"",$1); print " \""$1 "\" => \"" $2 "\","}' input.txt`

Alors que c’est pas fou hein en soi, mais c’est tellement satisfaisant quand ça marche !

Oh masters of the terminal.
I need your wisdoms

If i have tab as field separator in awk
and lets say field $3 contains "whitespace" separated values.

Is that even possible?
I have a super messy log I am trying to look into
#awk #terminal