Skip to content

A shell script that converts a csv file (Excel Sheet) to an SQL file that can be imported in a MySQL database

License

Notifications You must be signed in to change notification settings

pavanchhatpar/csv-to-sql-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Excel Sheet(CSV) to SQL

A shell script that converts a csv file (Excel Sheet) to an SQL file that can be imported in a MySQL database

Purpose

This script was created as a part of Operating Systems' mini project in my Third Year BE. In order to learn usage of various shell commands on Linux, Shell Script was chosen to implement this tool. Later on, it came as a handy tool to convert large amounts of data received for college tech fest events as Excel Sheets to developer friendly SQL files which could be easily used on websites and applications.

Features and Limitations

  • Works only with .csv files which confine it to be used only on single sheet Excel Files.
  • It assumes the filename as table name and first row cells are taken as column names
  • The output filename is same as the input file but with an extension sql

Download

wget https://raw.githubusercontent.com/pavanchhatpar/csv-to-sql-converter/master/csv-sql.sh
chmod +x ./csv-sql.sh

Usage

$ sh csv-sql.sh <filename>.csv

Screenshots

CSV file

SQL file

About

A shell script that converts a csv file (Excel Sheet) to an SQL file that can be imported in a MySQL database

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages