Nushell is also quite powerful for this. For example:
> open people.csv | where status == 'customer' | unique-by email | select surname forename email | sort-by email | save customers.json
https://www.nushell.sh/