This Python script converts text files (.txt) into well-formatted Markdown files (.md). It normalizes line endings, replaces problematic characters, and beautifies the Markdown output to ensure readability and consistency. The script supports batch processing of files in a directory as well as single-file processing.
- Normalizes line endings to LF.
- Replaces problematic characters (e.g., Windows-1252 right single quotation mark).
- Beautifies Markdown output by removing excessive line breaks, formatting long lines, and adding emphasis to uppercase phrases.
- Supports processing of both single files and multiple files in a directory.
- Outputs processed files with a
_processedsuffix by default.
Ensure you have Python 3.x installed on your system. You can download Python from python.org.
- Run the script:
python process_to_markdown.py- Choose Processing Mode:
- Process Directory: Select a directory containing
.txtor.mdfiles to process. Specify an output directory where the converted files will be saved. - Process Single File: Select a single
.txtor.mdfile to process. Choose the output file location for the converted Markdown file.
- Processing Options:
- Files are processed to replace problematic characters and beautify Markdown.
- Processed files are saved with a
_processedsuffix by default.
Thank you for using Useful-Tools!