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

github.com/ruzhila/excel_csv_to_json_or_markdown

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
e

github.com/ruzhila/excel_csv_to_json_or_markdown

v0.0.0-20240430103238-dca013569028
99

Supply Chain Security

100

Vulnerability

100

Quality

100

Maintenance

100

License

Version published
Created
Issues
0

Excel/CSV to JSON/Markdown Converter

This repository contains a Go program that converts data from Excel or CSV files to JSON or Markdown format.

By ruzhila.cn, a campus for learning backend development through practice.

🚀 100-line-code A collection of learning projects written in 100 lines of code

This is a tutorial code demonstrating how to use Golang for data transformation. Pull requests are welcome. 👏

Description

The program takes two command-line arguments: the input file and the output file. It reads the data from the input file and writes it to the output file in the specified format. The format is determined by the file extension.

  • If the output file has a .json extension, the program writes the data as an array of JSON objects. The keys of the objects are taken from the first row of the input file, and each subsequent row is written as a separate object.

  • If the output file has a .md extension, the program writes the data as a Markdown table.

Usage

go run main.go input.xlsx output.json
go run main.go input.csv output.md

Dependencies

This program uses the following Go libraries:

  • encoding/csv for reading CSV files
  • encoding/json for writing JSON files
  • os for file operations
  • path/filepath for handling file paths
  • github.com/qax-os/excelize for reading Excel files

FAQs

Package last updated on 30 Apr 2024

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