From owner-freebsd-questions@FreeBSD.ORG Fri Nov 21 13:36:49 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DC8E1065672 for ; Fri, 21 Nov 2008 13:36:49 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id C7E348FC0C for ; Fri, 21 Nov 2008 13:36:48 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r55.edvax.de (port-92-196-26-78.dynamic.qsc.de [92.196.26.78]) by mx01.qsc.de (Postfix) with ESMTP id 516FB507A3; Fri, 21 Nov 2008 14:36:46 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id mALDahUD014924; Fri, 21 Nov 2008 14:36:43 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Fri, 21 Nov 2008 14:36:43 +0100 From: Polytropon To: pwn Message-Id: <20081121143643.b732042a.freebsd@edvax.de> In-Reply-To: <4926922C.8050702@gmail.com> References: <4926922C.8050702@gmail.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: ascii text format X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2008 13:36:49 -0000 On Fri, 21 Nov 2008 10:49:16 +0000, pwn wrote: > what software/tool can i use for format my *.txt? there is command on > VIM like "set textwidth" but this is not suitable for me. any help i > appreciate. Judging from your example text, what you're searching for is a tool to format your text in paragraph mode (block mode) using spaces between the words. I'm not sure if there's already a tool on FreeBSD that does the trick, but you can surely write a simple awk script to do it. I'd suggest something like this: Break each input line into words using the space character as separator. Then, iterate over these words and put spaces after each word; repeat this until you've reached the desired text width. This should be relatively easy to accomplish. Furthermore, you can add an empty string before each output line in order to create a left margin. -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...