Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/giorgimakharadze/csv-json-converter-cli-golang
https://github.com/giorgimakharadze/csv-json-converter-cli-golang
golang
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/giorgimakharadze/csv-json-converter-cli-golang
- Owner: GiorgiMakharadze
- License: mit
- Created: 2023-09-13T17:09:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-13T20:29:23.000Z (over 1 year ago)
- Last Synced: 2024-04-09T14:44:51.186Z (9 months ago)
- Topics: golang
- Language: Go
- Homepage:
- Size: 2.82 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csv-json-converter-CLI-golang
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
This repository houses a simple CLI (Command Line Interface) application written in Go. The tool allows for the conversion of CSV files to JSON format and vice versa.
## Prerequisites
- Go 1.16 or higher. [Download here](https://golang.org/dl/)
## Getting Started
Clone the repository to your local machine using the following command:
```sh
$ git clone https://github.com/GiorgiMakharadze/csv-json-converter-CLI-golang.git$ cd csv-json-converter-CLI-golang
```## Building the App
```sh
$ make build
```## Usage
The CLI tool takes three arguments:
1. Conversion direction (either "csvtojson" or "jsontocsv").
2. Input file path.
3. Output file path.Use the tool as follows
```sh
$ ./bin/csvjsonconverter csvtojson input.csv output.json
```or
```sh
$ ./bin/csvjsonconverter jsontocsv input.json output.csv
```If the conversion is successful, it will output: `Conversion successful!`
## Test the App
```sh
$ make test
```This will execute the test cases and output the results.
## Cleaning Up
You can clean up generated files using commands from the Makefile:
1. To remove a specific file:
```sh
$ make clean file=filename.csv/json
```2. To remove all CSV and JSON files:
```sh
$ make clean-all
```3. To delete all files with a specified extension:
```sh
$ make delete type=csv/json
```