linux_ws2122/awk/06-aufgabe.awk
Markus Pesch fed26c8bbd
All checks were successful
continuous-integration/drone Build is passing
Initial Commit
2021-10-13 19:25:16 +02:00

30 lines
754 B
Awk

#!/bin/awk
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s }
function trim(s) { ; return rtrim(ltrim(s)); }
function validBool(s) {
if (s == "ja" || s == "nein") {
return "1";
} else {
return "0";
}
}
{
if (FNR > 1) {
if ( validBool($4) == "0" ) { next; }
if ( validBool($9) == "0" ) { next; }
if ( validBool($10) == "0" ) { next; }
if ( validBool($15) == "0" ) { next; }
if ( validBool($16) == "0" ) { next; }
if ( validBool($17) == "0" ) { next; }
if ( validBool($19) == "0" ) { next; }
if ( validBool($21) == "0" ) { next; }
if ( validBool($22) == "0" ) { next; }
if ( validBool($23) == "0" ) { next; }
}
print trim($0)
}