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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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