Last active
June 15, 2022 13:28
-
-
Save adrianbiro/9a7cfd1e7dd31f97984949e6883a4df8 to your computer and use it in GitHub Desktop.
Generate attendance at the conference for the report as a CSV file.
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
#!/bin/bash | |
#for i in {1..100}; | |
#do | |
# curl https://randomuser.me/api/ >> conference_attendance.json | |
#done | |
curl https://randomuser.me/api/?results=700 >> conference_attendance.json | |
echo '"Lastname","Forename","Age","City","Country"' > conference.csv | |
jq -rC '[.results[] | select(.dob.age > 21) | {person: [.name.last, .name.first, .dob.age, .location.city, .location.country]}] | sort_by(.name.last) | reverse | .[] | add | @csv' conference_attendance.json >> conference.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment