Skip to content

esbb48/transform-csv-to-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

transform-csv-to-sql

Note

  1. You should prepare a .csv file
  2. It's to mysql
  3. The first row isn't column defined. It means all rows which should be data.

Sample Demo

1. Exec cli

$ npm install
$ npm run demo

2. See the file in ./output/sql_sample_xxxxx.sql

Setup

1. Put .csv file in input folder

2. Update params

{
  columnArray: [] # Insert SQL Column
  csvHeader: {} # Column Defined
  inputFileName: "xxx.csv"
  tableName: "`table`" or "`database`.`table`"
  outputFileName: "xxx"
  initRowData: function() {
    return {
    }
  }
}

3. Add Some transform Logical in lib/index.js (option)

4. Exec cli

$ npm install
$ npm start

5. You can see the success message in terimal, and it will return output path.

About

Setup config and you can get the .sql file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published