csv2json library

A package to convert CSV data to JSON format.

This package provides functionality to convert CSV data represented as strings or files into JSON format. It trims spaces from headers and values to ensure clean and consistent JSON output.

Functions

csv2json(String csv) List<Map<String, String>>
Converts CSV data to JSON format.
csvFileToJson(String filePath) Future<List<Map<String, String>>>
Reads a CSV file from the given file path and converts its content to JSON format.
csvToJsonFile(String csv, String outputFilePath) Future<void>
Converts CSV data to JSON format and writes it to a file.
writeJsonToFile(List<Map<String, String>> jsonData, String filePath) Future<void>
Writes JSON data to a file.