🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

github.com/GiorgiMakharadze/csv-json-converter-CLI-golang

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/GiorgiMakharadze/csv-json-converter-CLI-golang

v0.0.0-20230913202920-6e8f11aa7bb8
Source
Go
Version published
Created
Source

csv-json-converter-CLI-golang

License: 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

Getting Started

Clone the repository to your local machine using the following command:

$ git clone https://github.com/GiorgiMakharadze/csv-json-converter-CLI-golang.git

$ cd csv-json-converter-CLI-golang

Building the App

$ make build

Usage

The CLI tool takes three arguments:

  • Conversion direction (either "csvtojson" or "jsontocsv").
  • Input file path.
  • Output file path.

Use the tool as follows

$ ./bin/csvjsonconverter csvtojson input.csv output.json

or

$ ./bin/csvjsonconverter jsontocsv input.json output.csv

If the conversion is successful, it will output: Conversion successful!

Test the App

$ 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:

  • To remove a specific file:
$ make clean file=filename.csv/json
  • To remove all CSV and JSON files:
$ make clean-all
  • To delete all files with a specified extension:
$ make delete type=csv/json

FAQs

Package last updated on 13 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts