Created
June 6, 2012 00:17
-
-
Save mjf/2879051 to your computer and use it in GitHub Desktop.
par2ln.sed - join paragraphs lines with inverse indentation
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/sed -f | |
# par2ln.sed - join paragraphs lines with inverse indentation | |
# Copyright (C) 2012 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the terms of The MIT License | |
# Input: | |
# | |
# foo | |
# bar | |
# baz | |
# | |
# Output: | |
# | |
# foo bar baz | |
:a | |
$! N | |
s/\n\([ \t]\+\)/ / | |
t a | |
P | |
D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment