All Projects → hardy12994 → Xlconverter

hardy12994 / Xlconverter

Convert Excel File to Objects

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Xlconverter

Bigbash
A converter that generates a bash one-liner from an SQL Select query (no DB necessary)
Stars: ✭ 230 (+1990.91%)
Mutual labels:  query, converter
Seconds
Helpers for converting time to seconds.
Stars: ✭ 20 (+81.82%)
Mutual labels:  converter
Tailwindo
🔌 Convert Bootstrap CSS code to Tailwind CSS code
Stars: ✭ 606 (+5409.09%)
Mutual labels:  converter
Osm2xmap
Converter from OpenStreetMap data format to OpenOrienteering Mapper format.
Stars: ✭ 5 (-54.55%)
Mutual labels:  converter
Unitsnet
Makes life working with units of measurement just a little bit better.
Stars: ✭ 641 (+5727.27%)
Mutual labels:  converter
Wasm2kt
Web Assembly to Kotlin and Java converter. Allows to compile a C or C++ program/library, and generate a Kotlin or Java program/library.
Stars: ✭ 18 (+63.64%)
Mutual labels:  converter
Ox Hugo
A carefully crafted Org exporter back-end for Hugo
Stars: ✭ 591 (+5272.73%)
Mutual labels:  converter
Query
Query adds tools to aid the use of Ecto in web settings.
Stars: ✭ 23 (+109.09%)
Mutual labels:  query
Queryablelist
Python module to add support for ORM-style filtering to any list of items
Stars: ✭ 19 (+72.73%)
Mutual labels:  query
Online Markdown
A online markdown converter specially for Wechat Public formatting.
Stars: ✭ 812 (+7281.82%)
Mutual labels:  converter
Typescripttolua
Typescript to lua transpiler. https://typescripttolua.github.io/
Stars: ✭ 783 (+7018.18%)
Mutual labels:  converter
Pytorch2keras
PyTorch to Keras model convertor
Stars: ✭ 676 (+6045.45%)
Mutual labels:  converter
Pecee Pixie
Lightweight, easy-to-use querybuilder for PHP inspired by Laravel Eloquent - but with less overhead.
Stars: ✭ 19 (+72.73%)
Mutual labels:  query
Flowgen
Generate flowtype definition files from TypeScript
Stars: ✭ 622 (+5554.55%)
Mutual labels:  converter
Graphql Mst
Convert GraphQL to mobx-state-tree models
Stars: ✭ 22 (+100%)
Mutual labels:  converter
Sqlitebiter
A CLI tool to convert CSV / Excel / HTML / JSON / Jupyter Notebook / LDJSON / LTSV / Markdown / SQLite / SSV / TSV / Google-Sheets to a SQLite database file.
Stars: ✭ 601 (+5363.64%)
Mutual labels:  converter
Fluentpdo
A PHP SQL query builder using PDO
Stars: ✭ 783 (+7018.18%)
Mutual labels:  query
Voc2coco
A useful script for converting voc format annotations(generated by LabelImg or Labelme) to coco format annotations
Stars: ✭ 16 (+45.45%)
Mutual labels:  converter
Arf Converter
Bulk ARF file converter
Stars: ✭ 10 (-9.09%)
Mutual labels:  converter
Covid 19 Bert Researchpapers Semantic Search
BERT semantic search engine for searching literature research papers for coronavirus covid-19 in google colab
Stars: ✭ 23 (+109.09%)
Mutual labels:  query

Nowdays everything is easly maintain if we are dealing with objects .As I have face many problems while in uploading excel file ,taking data from excel and play with each Cell of excel file .This Converter is just a interface which helps to get objects from excel Or excel from objects.

link https://github.com/hardy12994/xlconverter

Here are the two Converters and Some Getters (define below) present in it :

  • Excel to Objects
  • Objects to Excel

Excel to Objects

let xlconverter = require('xlconverter');

 let path="abv/cac/ac/ac.xlsx";
 let sheet="sheet1";


 // xlToObjects, will provide objects of all the sheets present in xl sheet;

  xlconverter.xlToObjects(path, function (err, data) {
      console.log(err);
      console.log(data);
  });


 /**
 * data-
 *
 * [{},{},{}]
 * // object as rows
 */


 // xlToObjectsOfSheet, will provide objects of perticular sheet present in xl sheet;

  xlconverter.xlToObjectsOfSheet(path, sheet, function (err, data) {
      console.log(err);
      console.log(data);
  });

   /**
   * data -
   * {
   *   sheet1: [{},{},{}],
   *   sheet2: [{},{},{}]
   * }
   * // object as rows
   */
  

Objects to Excel

     let headers=["name","age"];
     let rows=[{ name:"hardy",age:21 },{ name:"hardy",age:21 }];
     let path="abc/cac/";
     let fileName="myNewSheet"; //.xlsx is by default
     let sheetName="sheet1";

     xlconverter.objectsToXl(headers, rows, path, fileName, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

      /**
      * if error -`sheetName` sheet not created
      * data -
      * `sheetName` sheet successfully created.
      */

Getters

We can use Excel Sheet as a very small Database as we can do Extractions from that by putting some queries, The query can be made in form of Objects, Arrays Thing can be achive like:

  • Any Perticular Row.
  • Any Perticular Column.
  • Get Number of Rows.
  • Get Number of Columns.
  • Get Data as Objects of Perticular Columns.

Get Row

  • Accept Query as Object Eg- {name:"Jhon",age:"21"}.
  • and type of query will be done.
  • Return Single Row which matches both Conditions First.
     let rowQuery= {name:"Jhon",age:"21"};
     let filePath="abc/cac/";
     let sheetName="sheet1";
     
     xlconverter.getters.row(filePath, rowQuery, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

    /**
    * data-
    *
    * {name:"Jhon", age:"21", f_name:"D_Jhon"}
    * // object as rows
    */


Get Rows

  • Accept Parameters as Object Eg- {name:"Jhon",age:"21"}.
  • and type of query will be done.
  • Return Multiple Rows which matches both Conditions.
     let rowQuery= {name:"Jhon",age:"21"};
     let filePath="abc/cac/";
     let sheetName="sheet1";
     
     xlconverter.getters.rows(filePath, rowQuery, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

    /**
    * data-
    *
    * [{name:"Jhon", age:"21", f_name:"D_Jhon"},
    * {name:"Jhon", age:"21", f_name:"D_Jhonee"}]
    * // object as rows
    */

Get Column

  • Accept Parameters as String Eg- "name".
  • Return Array of Strings which is Present in that Column.
     let colQuery= "name";
     let filePath="abc/cac/";
     let sheetName="sheet1";
     
     xlconverter.getters.coloumn(filePath, colQuery, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

    /**
    * data-
    *
    * ["Jhon","Jhon2","Jhon3"]
    * // as coloumn cells
    */

Get Columns

  • Accept Parameters as String in Array Eg- ["name","age"].
  • Return Object with Keys name and age and both of them have Array of Strings which is Present in respective Column.
     let colQuery= ["name","age"];
     let filePath="abc/cac/";
     let sheetName="sheet1";
     
     xlconverter.getters.coloumns(filePath, colQuery, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

    /**
    * data-
    *
    * {
    *  name:["Jhon","Jhon2","Jhon3"],
    *  age:[21,33,13]
    * }
    * // as coloumn cells
    */

Get Rows from Selective Columns

  • Accept Parameters as String in Array Eg- ["name","age"].
  • Return all Rows with Selected Columns name and age as Objects in Array
  • Getting Selective Coloumns of Rows.
     let colQuery= ["name","age"];
     let filePath="abc/cac/";
     let sheetName="sheet1";
     
     xlconverter.getters.selectiveColoumnsOfRows(filePath, colQuery, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

    /**
    * data-
    *
    * [
    *   {name: "hardy", age: 12},
    *   {name: "pery", age: 41},
    *   {name: "bob", age: 42}
    *  ]
    * // 
    */

N O T E :

  • callback function is required in all methods.
  • getters are using xlToObjectsOfSheet function that's why sheet name is required.

Contributions are most wellcome

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].