recfile fixes
This commit is contained in:
parent
5afc414a52
commit
d2934bf8a3
@ -44,6 +44,7 @@ recset -f "$new_field" --delete $database
|
||||
|
||||
- [Extended example](recfiles/extended.md)
|
||||
- [Playing with board games data](recfiles/Board_Games.md)
|
||||
- [Fixes](recfiles/recfixes.md)
|
||||
|
||||
# Resources
|
||||
|
||||
|
33
data/recfiles/recfixes.md
Normal file
33
data/recfiles/recfixes.md
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
title: "Recfixes"
|
||||
tags: [ "data", "recfiles" ]
|
||||
requires: "Recfiles"
|
||||
---
|
||||
|
||||
Sometimes `recsel` chokes on a large query, and you need to break the query into chunks with a pipe.
|
||||
|
||||
This Kickstarter file has 374,853 records.
|
||||
Here's the chonky query:
|
||||
|
||||
```sh
|
||||
recsel kick.rec -e "Category = 'Games'" -p "Subcategory,Avg(Goal)" -G Subcategory
|
||||
```
|
||||
|
||||
It breaks down like this:
|
||||
|
||||
| Chunk | Meaning |
|
||||
|:-----------------------------:|:---------------------------------------------:|
|
||||
| `recsel kick.rec` | Select records from `kick.rec` |
|
||||
| `-e "Category = 'Games'"` | Select only records where Category = 'Games' |
|
||||
| `-p "Subcategory,Avg(Goal)"` | Print the Subcategory and average goal |
|
||||
| `-G "Subcategory"` | Group by subcategory |
|
||||
|
||||
Two ways to break the query apart:
|
||||
|
||||
```sh
|
||||
recsel kick.rec -e "Category = 'Games'" | recsel -p "Subcategory,Avg(Goal)" -G "Subcategory"
|
||||
|
||||
recsel kick.rec -e "Category = 'Games'" > games.rec
|
||||
recsel games.rec -p "Subcategory" -G "Subcategory"
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user