Socket
Book a DemoInstallSign in
Socket

xlsx-to-directories

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xlsx-to-directories

xlsx-to-directories module expose one functionality that take a file with .xlsx extension and create a new directory for each row in the specified ouput directory.

1.0.0
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Xlsx to Direcotries Core

xlsx-to-directories module expose one functionality that take a file with .xlsx extension and create a new directory for each row in the specified ouput directory.

Structure of the .xlsx file

A1B1
1Azienda1
2Azienda2
...Azienda...

There must be two columns. Except for the first row that is intended as labels, the follwings rows must be of type number for the first column and type string for the second column.

How it works

Start parsing the file one row at a time. If it is the fist row (the row with the labels), do nothing. If the two columns of the row contains correct values, combine them into one single string. Otherwise do nothing for incorrect values. Create a new directory in the path specified in input using the new created srting as the directory name name. When there is no more rows left terminate the script.

How to use it

Install the module

npm i --save xlsx-to-directories

Import and usage

const xlsxToDir = require('xlsx-to-directories')

xlsxToDir('path_to_file', 'path_to_dir')
  .then(count => {
    console.log(`${count} new folder${count > 1 ? 's' : ''}`)
  })
  .catch(error => {
    console.error(error)
  })

FAQs

Package last updated on 02 Dec 2018

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.