All of lore.kernel.org
 help / color / mirror / Atom feed
From: CaT <cat@zip.com.au>
To: Peter <pfheiss@philonline.com>
Cc: linux-newbie@vger.kernel.org
Subject: Re: Text Reformatting
Date: Sun, 18 May 2003 14:23:18 +1000	[thread overview]
Message-ID: <20030518042318.GA1473@zip.com.au> (raw)
In-Reply-To: <20030518041124.07222103AE@pfheiss>

On Sun, May 18, 2003 at 12:11:19PM +0800, Peter wrote:
> I came up with the sausage
> 
> cat file.txt | tr -s " "  "\012" > file1.txt | fmt -u -w 105 file1.txt > 
> file2.txt
> 
> This does not maintain the paragraphs, however. Can sed do it and how?

sed -e 's/^[ 	]\+//' -e 's/[ 	]\+$//' <file.txt | fmt -u -w 105 >file1.txt

I added the 2nd regexp just to make sure there was nothing there. Tab and
a space inside the square brackets.

-- 
Martin's distress was in contrast to the bitter satisfaction of some
of his fellow marines as they surveyed the scene. "The Iraqis are sick
people and we are the chemotherapy," said Corporal Ryan Dupre. "I am
starting to hate this country. Wait till I get hold of a friggin' Iraqi.
No, I won't get hold of one. I'll just kill him."
	- http://www.informationclearinghouse.info/article2479.htm
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

  reply	other threads:[~2003-05-18  4:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <pfheiss@philonline.com>
2003-05-18  4:11 ` Text Reformatting Peter
2003-05-18  4:23   ` CaT [this message]
2003-05-18  4:23   ` raihan
2003-05-18  7:54   ` John Kelly
2003-05-19 15:44   ` Stephen Samuel
2003-05-20  2:47     ` Peter
2003-05-20  9:59       ` Stephen Samuel
2003-05-19  2:25 Peter
2003-05-19 12:17 ` Amin
2003-05-20  2:46   ` Peter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030518042318.GA1473@zip.com.au \
    --to=cat@zip.com.au \
    --cc=linux-newbie@vger.kernel.org \
    --cc=pfheiss@philonline.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.