From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1KrkXK-00010c-QA for garchives@archives.gentoo.org; Mon, 20 Oct 2008 02:30:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A59CFE0280; Mon, 20 Oct 2008 02:30:24 +0000 (UTC) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by pigeon.gentoo.org (Postfix) with SMTP id 48519E0280 for ; Mon, 20 Oct 2008 02:30:24 +0000 (UTC) Received: (qmail invoked by alias); 20 Oct 2008 02:30:22 -0000 Received: from p54852D53.dip0.t-ipconnect.de (EHLO localhost) [84.133.45.83] by mail.gmx.net (mp067) with SMTP; 20 Oct 2008 04:30:22 +0200 X-Authenticated: #20088476 X-Provags-ID: V01U2FsdGVkX1+ijhQYtWyiGtqv5hvHi87fwNNEmNxZdxbRs3p5ns CLPXXjsglTzd2j Received: from localhost ([127.0.0.1] helo=solfire) by localhost with esmtp (Exim 4.69) (envelope-from ) id 1KrkXF-0007kt-Bt for gentoo-user@lists.gentoo.org; Mon, 20 Oct 2008 04:30:21 +0200 Date: Mon, 20 Oct 2008 04:30:21 +0200 From: meino.cramer@gmx.de To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] how to word-wrap using a pipe? Message-ID: <20081020023021.GC6111@solfire> References: <48FBDB4A.9070109@realss.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <48FBDB4A.9070109@realss.com> User-Agent: mutt-ng/devel-r804 (Linux) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.5600000000000001 X-Archives-Salt: 4d96b0d2-1083-4235-b0da-91947eb00020 X-Archives-Hash: 0cae96892d3be4377d06d53be8f042f5 Hi =2E..just a shot in the dark: Try 'fmt' (UNIX standard too so no extra install I think). Kind regards, Meino Cramer zhangweiwu@realss.com [08-10-20 03:52]: > Hello. How can I line-wrap a text file that was not wrapped before (e.g. > like text file created on Microsoft Windows's notepad, the software does > softwrap by default, thus the file created using it often have very long > text lines) by using command pipe? >=20 > I could use vim, activate some formatting options and use gq. But that > couldn't be used on a pipe. >=20 > I could use groff, but that command line looks too complicated: >=20 > $ head -n1 max_payne | groff -Tutf8 | grep --invert-match ^$ > Life was good. A house on the Jersey side across the river. The > smell of freshly cut lawns. The sounds of children playing. A > beautiful wife and a baby girl. The American dream come true. But > dreams have a nasty habit of going bad when you=E2=80=99re not looking. >=20 >=20 > Besides groff wraps not according to the console term width, but > according to the paper size in /etc/paper. It would be nice to have > something wrap my text by using console width (what you get with '$ stty > -a | head -n1') >=20 > --=20 > Real Softservice >=20 > Huateng Tower, Unit 1788 > Jia 302 3rd area of Jinsong, Chao Yang >=20 > Tel: +86 (10) 8773 0650 ext 603 > Mobile: 159 1111 7382 > http://www.realss.com >=20 >=20 --=20 Please don't send me any Word- or Powerpoint-Attachments unless it's absolutely neccessary. - Send simply Text. See http://www.gnu.org/philosophy/no-word-attachments.html In a world without fences and walls nobody needs gates and windows.