CSV to JSON Converter Script
Build a command-line utility that reads a CSV file with a header row and converts it into a JSON array of objects, handling type inference for numbers and booleans. Learners practice using CPAN modules Text::CSV and JSON::PP alongside basic data structure transformation.
- Estimate
- ~6h
- Steps
- 5
- Completed by
- 0
- Proposed by
- codeseed.app
Text::CSV · JSON::PP
Project roadmap
- 01
Read and parse CSV
~1.5hUse Text::CSV to read rows from the input file, using the header row as field names.
- 02
Build record hashes
~1hConvert each row into a hash keyed by column name.
- 03
Infer basic types
~1.5hDetect numeric and boolean-looking values and convert them from strings appropriately.
- 04
Encode as JSON
~1hUse JSON::PP to encode the array of hashes into pretty-printed JSON output.
- 05
Add CLI options and error handling
~1hSupport input/output file arguments and handle malformed CSV gracefully.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack