Nu Shell Is Cool
Justin Garrison
January 6, 2024
I had a csv file with data that looked like this.
And I needed to convert the date field into this:
I tried to do this with awk first because it seemed like it would be a good fit.
I'm sure it's possible but the syntax is obscure and I couldn't figure it out.
I ended up with something like this (not working):
When I can't get something in a single for loop or a few pipes I'll reach for a general purpose programming language.
So I fired up iPython and wrote this to convert the file.
This works but it was more verbose than I wanted.
I'm sure there's other ways to do it, but it felt like something I should be able to do in my shell.
Finally, I tried it with nu:
It was a more elegant and readable solution.
I'm very impressed with how far nu has come and thankful for their helpful community who helped me quickly figure this out.
Discussion in the ATmosphere