Skip to content

dovicsin/python-bulk-file-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

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.

Usage

py main.py source.xlsx

Flags

Name Flag Short Default Required Description
Target directory --target -t dist/ false Target directory when saved all file
Create dirs --dirs -d true false Create directory every files
Add header --addheaderkey -a true false Add header key in content with join separator
Join --join -j = false The 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)

name extension TITLE DESCRIPTION DATE ETC
file-1 txt First title Description value 2023 etc parameters
file-2 txt Second title Description value 2020 other
file-3 pdf Pdf title Pdf desc 2024 ...

Result

py main.py source.xlsx
dist
  sheet-1
    file-1
      file-1.txt
    file-2
      file-2.txt
    file-3
      file-3.txt

Without plus dirs

py main.py 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

py main.py source.xlsx -a false
name extension CONTENT
file-1 txt First content \n more lines
file-2 txt Sec content
file-3 txt Content

file-1 final content

First content
more lines

Supported source extensions

  • xlsx
  • xsl
  • ods (with odfpy extension)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages