Skip to main content
6 events
when toggle format what by license comment
Sep 16, 2020 at 9:17 comment added AdminBee @Cbhihe True, that is indeed a way to make it more efficient. I will keep it in mind for future answers :)
Sep 16, 2020 at 9:14 comment added Cbhihe Mmmh...I'm with you for not golfing in this forum, but with next in 1st rule's set of braces, you could do away with NR>FNR in the 2nd rule, AND replace the last occurrence of NR>FNR with {print}. This was exactly what I was thinking, but decided not to mention it earlier, because style is... style. It's hard to argue against it, especially if the answer is flawless. ;-)
Sep 16, 2020 at 9:00 comment added AdminBee @Cbhihe True. Although I usually try to make the code readable rather than "golfed", writing it this way is shorter than having next in the first and print in the second rule ;)
Sep 16, 2020 at 8:45 comment added Cbhihe +1 Slightly more complete than the accepted solution, although imho your 2nd NR>FNR at the end is as awkward (pun intended) as it is necessary to print things out.
Sep 15, 2020 at 12:36 history edited AdminBee CC BY-SA 4.0
output redirection
Sep 15, 2020 at 12:31 history answered AdminBee CC BY-SA 4.0