awk-hack-the-planet icon indicating copy to clipboard operation
awk-hack-the-planet copied to clipboard

Awk proficient [18.awk]: There is a simpler solution.

Open stef-rausch opened this issue 1 year ago • 0 comments

Thank you so much for your Youtube videos and the challenges! I enjoyed them while finally learning Awk.

Your solution 18.awk is interesting. This is my alternative approach:

#!/usr/bin/awk -f

BEGIN { FS = "\t"; first = 20240811; name = "Employee"; started = "Date" }

{ date = $7; gsub("/", "", $7); if ($7 < first) { first = $7; name = $1 " " $2; started = date } }

END { printf("The first employee hired was %s on %s.\n", name, started) }

I like simplicity. 😉

stef-rausch avatar Aug 11 '24 00:08 stef-rausch