awk-hack-the-planet
awk-hack-the-planet copied to clipboard
Awk proficient [18.awk]: There is a simpler solution.
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. 😉