Download presentation
Presentation is loading. Please wait.
Published byEgbert Carroll Modified over 8 years ago
1
Querying CSV Files with SQL using ‘q’ Presented by Simon Frank
2
Context Working with data often means dealing with delimited files (CSV, TSV, etc…) Import delimited file(s) into data model Export data from data model into delimited file(s)
3
Some Common Challenges File not in correct format Column order screwed up Incorrect formatting Categorical values not correctly mapped Data contains duplicates Data incomplete / different from the previous file And so on…
4
Cry Me A River, Buddy Stop complaining and deal with it! Fix it with your text editor Edit it in Excel Ever heard of Grep, Awk or Sed? What about a.Net console app or a Python script? BCP it into SQL Server and query it from there
5
Finally – The Point Dealing with import and export files suck We have more interesting things to do Quick and easy to finish the job with SQL We already know SQL!
6
Enter q Command line tool to run SQL queries on delimited files http://harelba.github.io/q/ Implementation: In-memory table Supports all sqlite3 query constructs
7
DEMO
8
FREEDOM !
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.