Commit f4afb030 authored by Cyril Matthey-Doret's avatar Cyril Matthey-Doret
Browse files

add oneliner to combine forks from two runs

parent 82e3d6e2
Pipeline #332017 passed with stage
in 2 minutes and 44 seconds
......@@ -26,7 +26,7 @@ $ jq '
* Find all students present in multiple groups
```sh
$ jq '.[] | .members | map(.name) | .[]' forks.json \
$ jq '.[].members[].name' forks.json \
| sort \
| uniq -dc
......@@ -39,10 +39,15 @@ $ jq '.[] | .members | map(.name) | .[]' forks.json \
# 1. Get the list of students in groups, sort it
# 2. Sort the list of all enrolled students
# 3. Find names which are in enrolled students, but not grouped students
jq '.[] | .members | map(.name) | .[]' forks.json \
$ jq '.[].members[].name' forks.json \
| sort \
| uniq -d \
| sed 's/^ *//' \
| comm -23 <( sort enrolled_students.txt) -
"John Smith"
```
* Combine forks from two different runs into a single json (for groups present in both files, the entry from run1.json is selected).
```sh
jq -s '.[0] + .[1] | unique_by(.group)' run1.json run2.json > both_runs.json
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment