1.0.3 • Published 11 months ago

@dovicsin/bulk-file-creator v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Bulk file creator

Create bulk files with or without structured directories. Be it a configuration file or a plain text file.

The source should be a plain table that contains the header and beyond that each row will be a separate file. Just parameterize it with the appropriate flags and you're ready with lots of new files.

Install

npm install --global @dovicsin/bulk-file-creator

Usage

bulk-file-creator -s source.xlsx

Flags

NameFlagShortDefaultRequiredDescription
Source file--source-sNonetrueSource file (supported: xlsx, xls, ods)
Target directory--target-tdist/falseTarget directory when saved all file
Create dirs--dirs-dtruefalseCreate directory every files
Add header--addheaderkey-atruefalseAdd header key in content with join separator
Join--join-j=falseThe target file content line and header separator

Source format headers

  • name - First column contained the file names
  • extension - Second column contained all file extension (not required)
  • Every other column contained file content. The first row value is a line parameter name.

Example source (sheet-1)

nameextensionTITLEDESCRIPTIONDATEETC
file-1txtFirst titleDescription value2023etc parameters
file-2txtSecond titleDescription value2020other
file-3pdfPdf titlePdf desc2024...

Result

bulk-file-creator -s source.xlsx
dist
  sheet-1
    file-1
      file-1.txt
    file-2
      file-2.txt
    file-3
      file-3.txt

Without plus dirs

bulk-file-creator -s source.xlsx -d false
dist
  sheet-1
    file-1.txt
    file-2.txt
    file-3.txt

file-1.txt

TITLE=First title
DESCRIPTION=Description value
DATE=2023
ETC=etc parameters

Example simple content

bulk-file-creator -s source.xlsx -a false
nameextensionCONTENT
file-1txtFirst content \n more lines
file-2txtSec content
file-3txtContent

file-1 final content

First content
more lines

Supported source extensions

  • xlsx
  • xls
  • ods
1.0.3

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago