Created
October 24, 2014 12:30
-
-
Save innermond/eb0a13b965ea9c5a34e1 to your computer and use it in GitHub Desktop.
Remove all extra newlines and make the paragraphes pandoc-able
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
files=$1 | |
for file in $files; do | |
# first delete all empty, succesive lines | |
# then add an extra newline | |
sed -i -r ':a;/^$/{d;ba};x;s/^.+$/\n/g;p;x' "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment