A lightweight Java project for converting between CSV and JSON formats using a command-line interface (CLI).
- Convert CSV files to JSON with options for pretty formatting.
- Convert JSON files to CSV efficiently.
- Save output files in the same directory as the input file or a custom directory.
- Handles individual files for conversion.
- Java 17 or higher
- Maven for building and running the project.
-
Clone the repository:
git clone https://github.com/Roma4ka-RedBad/supercell-csv-json-tool.git cd supercell-csv-json-tool
-
Build the project with Maven:
mvn clean package
-
Run the application:
java -jar target/csv-json-tool-0.0.1.jar
The project provides two primary commands:
java -jar target/csv-json-tool-0.0.1.jar csv2json <input_filepath> [--output <output_filepath_or_directory>] [--pretty]
-
Convert
data.csv
todata.json
in the same directory:java -jar target/csv-json-tool-0.0.1.jar csv2json data.csv
-
Convert
data.csv
tooutput.json
with pretty formatting:java -jar target/csv-json-tool-0.0.1.jar csv2json data.csv --output output.json --pretty
java -jar target/csv-json-tool-0.0.1.jar json2csv <input_filepath> [--output <output_filepath_or_directory>]
-
Convert
data.json
todata.csv
in the same directory:java -jar target/csv-json-tool-0.0.1.jar json2csv data.json
-
Convert
data.json
to a specific directory:java -jar target/csv-json-tool-0.0.1.jar json2csv data.json --output /path/to/directory
CSV.java
: Main class for converting CSV to JSON.JSON.java
: Main class for converting JSON to CSV.cli/
CSV2JSON.java
: CLI command for converting CSV to JSON (designed for end-users).JSON2CSV.java
: CLI command for converting JSON to CSV (designed for end-users).Main.java
: Entry point for running the CLI application.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a clear explanation of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.