Created
January 31, 2017 16:17
-
-
Save gwpl/58bff94fd84efb55cfa21430c9202732 to your computer and use it in GitHub Desktop.
csvsql_inventory_join.sh example of csvsql sql query joining scanned barcodes with bardcodes database into more meaningful output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | name | |
---|---|---|
23 | Toy T | |
44 | Movie M2 | |
68 | Music CD 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| id | name | | |
| -- | ---------- | | |
| 23 | Toy T | | |
| 44 | Movie M2 | | |
| 68 | Music CD 2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
csvsql \ | |
--query "select i.id, name from | |
items as i join inventory_mini as v | |
on (i.id = v.id)" \ | |
items.csv inventory_mini.csv \ | |
| tee csvsql_inventory_join.output.csv \ | |
| csvlook | tee csvsql_inventory_join.output.csvlook.txt |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | |
44 | |
23 | |
68 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | name | |
---|---|---|
23 | Toy T | |
45 | Movie M1 | |
44 | Movie M2 | |
43 | Movie M3 | |
67 | Music CD 1 | |
68 | Music CD 2 | |
69 | Music CD 3 | |
70 | Music CD 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment