2 ms·
I don't have time to put together a submission but I'm willing to bet you can use this: https://github.com/kjdev/php-ext-jq https://github.com/kjdev/php-ext-jq
by chrismarlow9 8mo ago
I don't have time to put together a submission but I'm willing to bet you can use this:
https://github.com/kjdev/php-ext-jq https://github.com/kjdev/php-ext-jq
And replicate this command:
jq -R '
[inputs | split(",") | {url: .[0], date: .[1] | split("T")[0]}] |
group_by(.url) |
map({
(.[0].url): (
map(.date) |
group_by(.) |
map({(.[0]): length}) |
add
)
}) |
add
' < test-data.csv
And it will be faster than anything you can do in native php
Edit: I'm assuming none of the urls have a comma with this but it's more about offloading it through an extension, even if you custom built it
- Retr0id 8mo agoThe rules exclude FFI etc.