Perl 6? :
use JSON::Fast; my $json = 'data.json'.IO.slurp; my $d = Date.today; my $out-filename = sprintf "%04i%02i%02i.csv", $d.year, $d.month, $d.day; my $out = $out-filename.IO.open(:w); for from-json($json).list -> %row { if %row<creditcard> { $out.say: %row<name>, ',', %row<creditcard>; } } $out.close;
Of course in reality you'd probably want to use Text::CSV to properly format the CSV output in order to handle quoting and escaping properly.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Perl 6? :
Of course in reality you'd probably want to use Text::CSV to properly format the CSV output in order to handle quoting and escaping properly.