Giter Club home page Giter Club logo

parse-a-file-and-save-to-db's Introduction

Parse-a-file-and-save-to-DB

Requirements: NodeJS envoirnment MySQL Database Text Editor Database File(.txt, csv, sql or any)

Tasks Done: The txt.file is converted to csv file. This file is parsed. The data is stored in MYSQL database. NodeJs is used to parse the csv file and stored it in database.

Steps:

  1. Read the CSV file via fs node module.
  2. Make connections to the Mysql database.
  3. Parse the csv file.
  4. Write a query to create table ‘zuri’ in Zuri database.
  5. Write a query to push the parsed csv file values to the database.

Running the program:

  1. Extract the folder
  2. Save it in a particular location
  3. Have your NodeJS envoirnment running.
  4. Go the location you saved the extracted folder.
  5. Run the following commands: npm init npm install express npm install csvjson npm install mysql node main.js That’s it 

Command Prompt Output:

alt text

Database Output:

alt text

alt text

alt text

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.