Skip to main content

Merge multiple text files into one

Project description

File merger

Merge multiple files into one. Support inserting code as markdown code blocks.

Configuration file

Key Description Default value
files array with input files names 1 -
folder sub-folder, where files located -
output output file name with optional path, relative to config location -
extension extension for all input and output files 2 -
add_file_names add file name before its text, or not false
file_label what write before file name File:
remove_folder extract from 'folder/file.txt' only 'file.txt', for use in file name 3 false
code_in_md write code in markdown file between back-tics ``` with file extension for highlighting false
ask_overwrite ask for overwrite or not false
empty generate empty file by path 4 false
use use this config file or not true

1 All the contents of the files are combined in the order of the files. In this list you can use key text instead of file name for inserting any text between file's content:

files:
  - text: 'some text'

2 If specified, you should write the names of all files without extensions.

3 Used with the add_file_names flag enabled.

4 If specified, no other parameters are needed:

empty: path/to/result/file

Running

python path/to/file_merger.py -f FOLDER -c CONFIG_NAME

-f - Absolute path to folder with project, default is from where script run.

-c - Config file name, default is file-merger.yaml (e.g. folder/config.yaml).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

file-merger-0.1.0rc2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

file_merger-0.1.0rc2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file file-merger-0.1.0rc2.tar.gz.

File metadata

  • Download URL: file-merger-0.1.0rc2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.18.1-arch1-1

File hashes

Hashes for file-merger-0.1.0rc2.tar.gz
Algorithm Hash digest
SHA256 3111aa5fa9e0807af89c0e7260c6e9abd31fe88d66bee535be0ace869eaa2d3d
MD5 0c1f9d5415b526ba0e6dc948c704c039
BLAKE2b-256 74a20e9d4d112067a04a26b8a4c5bce591d8176e5a077ef40a271a1115055ea0

See more details on using hashes here.

File details

Details for the file file_merger-0.1.0rc2-py3-none-any.whl.

File metadata

  • Download URL: file_merger-0.1.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.18.1-arch1-1

File hashes

Hashes for file_merger-0.1.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 dac888f527c8d076a41895fc9771f900195377d0df876264fd166894a7a0752a
MD5 4697d1b6f23ea6db3e0e73a4f199947f
BLAKE2b-256 ccd7617985941daac4e9e703e38b1f5e782640390f008f936f97a7a1fb6b65ff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page