text/fix_whitespace
- 655 bytes
- Python
- View raw
1#!/usr/bin/env python3
2"""
3Remove extra whitespace from a text file.
5When I copy/paste text from the web into Obsidian, it's often inserted
6with a lot of additional whitespace, e.g. text like
8 hello\n\nworld
10becomes
12 hello\n\n \n\nworld
14This script cleans up some of this extraneous whitespace for me.
15"""