Tech tip of the day for those who have to deal with CSV files
-
I discovered these life-changing utilities today:
https://csvkit.readthedocs.io/en/latest/Instead of going through the intense pain of importing tables into something like Excel, they allow you to just SQL-query your data on the command line instead.
For instance, if we have data about exam results in a CSV file and I want a histogram of the result distribution, I just do
> csvsql -I --table grades examresults.csv --query 'SELECT Grade,COUNT(*) AS Count FROM grades GROUP BY Grade' Grade,Count "1,0",3 "1,7",13 "2,0",24 "2,3",25 "2,7",42 "3,0",53 "3,3",53 "3,7",81 "4,0",32 "5,0",132Ever tried something like that in Excel? It's a PITA.
I can't believe I've managed to live my life until this point without this tool.
-
@Horace said in Tech tip of the day for those who have to deal with CSV files:
That would come in handy if I could craft SQL queries off the top of my head like that.
Believe it or not, but mastering SQL is a tiny task compared to mastering Excel. Also, using SQL is already the advanced use case. Many of the tools work out-of-the-box without the need for SQL.
Their true power comes from their composability, thanks to the Unix philosophy. Ken Thompson and Dennis Ritchie should have been award the Nobel peace prize or something.
-
ISnt that a US pharmacy? LOL
-
ISnt that a US pharmacy? LOL
@taiwan_girl said in Tech tip of the day for those who have to deal with CSV files:
ISnt that a US pharmacy? LOL
"CVS"
-
@taiwan_girl said in Tech tip of the day for those who have to deal with CSV files:
ISnt that a US pharmacy? LOL
"CVS"
@George-K :woman-facepalming:
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login