Utility for splitting files into smaller parts
Project description
• Features • How to Use • Usage • Follow the Prompts • Installation via PyPI • Help License
File Splitter by Lines
This Python script provides a simple yet powerful way to split large text files into smaller files based on the specified number of lines per file. It is designed to facilitate easier management and processing of large datasets by breaking them down into manageable chunks.
Features
- Command-line Interface: Easily specify the input file and the number of lines per output file using command-line arguments (
-f/--filesand-l/--lines). - Clear Feedback: Error messages are displayed in red for quick identification of issues, while success messages are shown in green upon successful file creation.
- Cross-platform Compatibility: Works seamlessly on Windows, Unix, and Linux systems.
- Automatic Folder Creation: Automatically creates a 'results' folder to store the split files if it doesn't already exist.
- User-friendly Interface: Includes an ASCII art banner for visual appeal and clear prompts for user interaction.
How to Use
Clone the Repository
git clone https://github.com/X-Projetion/split-files.git
cd split-files
Usage
- python file_splitter.py -f input_file.txt -l 100
- Replace input_file.txt with your desired input file and 100 with the number of lines per output file.
Follow the Prompts
- The script will create a 'results' folder (if not already present) and split the file accordingly.
- Follow on-screen instructions to exit or continue after completion.
Installation via PyPI
You can also install split-files via PyPI for easy access:
- pip install split-files
Help
python3 main.py -h
_____ ___ __ _______ __
/ ___/____ / (_) /_/ ____(_) /__ _____
\__ \/ __ \/ / / __/ /_ / / / _ \/ ___/
___/ / /_/ / / / /_/ __/ / / / __(__ )
/____/ .___/_/_/\__/_/ /_/_/\___/____/v1
/_/ x-projetion.org
usage: main.py [-h] -f INPUT_FILE -l LINES_PER_FILE
File Splitter by Lines
optional arguments:
-h, --help show this help message and exit
-f INPUT_FILE, --files INPUT_FILE
Input file name
-l LINES_PER_FILE, --lines LINES_PER_FILE
Number of lines per file
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
split_files-1.0.tar.gz
(3.0 kB
view details)
File details
Details for the file split_files-1.0.tar.gz.
File metadata
- Download URL: split_files-1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6bff72d9224e3e4f2dd480125dcc144998d723db648886c862b45550dec93c9
|
|
| MD5 |
4bab04393df238a8611b3faba04ae4b6
|
|
| BLAKE2b-256 |
9739c061192b7137f6fb0613c0ed643f51aa3a722c5c8098568822a90d5b99d0
|