chapter2: report persons by state

This commit is contained in:
Markus Pesch 2024-09-03 16:14:35 +02:00
parent e3b2c7d410
commit cf86ddfc59
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982

View File

@ -0,0 +1,17 @@
#!/bin/bash
cat ../data/persons.csv | \
awk -F ',' '{
print $6 ", " $2 " " $1;
}' | \
sort | \
awk -F ',' '
{
if ($1 == LastState) {
print "\t" $2;
} else {
LastState = $1;
print $1;
print "\t" $2;
}
}'