GithubHelp home page GithubHelp logo

python-bulk-file-creator's Introduction

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)

python-bulk-file-creator's People

Watchers

Tamás Dovicsin avatar

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.