Text-File-Line-Trimmer is a simple Python script designed to format text files by ensuring that each line does not exceed 120 characters in length.
- Reads the content of a specified text file.
- Formats the content to ensure no line exceeds 120 characters.
- Writes the formatted content back to the same file.
- Python 3.x
- Place the script in the directory containing your text file or adjust the path accordingly in the script.
- Run the script:
python Text-File-Line-Trimmer.py
By default, the script is set to format "textfile.txt". To format a different file, replace the filename in the format_file()
function call at the end of the script.
If you found this helpful, please consider:
- Buymeacoffee: Link