From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02RNJC5n024833 for ; Fri, 27 Mar 2020 19:19:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 149721055235; Fri, 27 Mar 2020 23:19:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0EB701055233 for ; Fri, 27 Mar 2020 23:19:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 35C4F800260 for ; Fri, 27 Mar 2020 23:19:10 +0000 (UTC) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=dkim.mimecast.com; s=201903; t=1585351149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FfpTtYJCaaNDO6ocmGK90EA3dNP4Zc7k12fenOXflts=; b=Qfvdv58O5Z7omvVoF58QPBCd3MmrMWIWsKtSR4R0U04Hx4CZewG9Cmtqrej/7HeZyOlZ2L M7h/mhgE08Mg2Z4OLMGh+vBJt3xC0joFk8+R4h7huR/RifudDNRS5G7KTah09WckWY1QqB 7zmzFjLG53gdW6aKHf0sXKoWGufaWZCmvNA3+Kwkg0iaiVSpuoy0DoOSx3WbrNZnqW0y/A uP5XT5TDiIX1LSjAAQxgyaTHwPmq34hTdhTTyScLFX3hpA+Vtx0TjgWqK0oVhzZIgKO0qp KH73IubOvXnEOqLRR0DMTlZ9UkIP0vldqNPYQacZLnryQX7L5kfZGatKFHbunA== ARC-Seal: i=1; s=201903; d=dkim.mimecast.com; t=1585351149; a=rsa-sha256; cv=none; b=HgW37BppseZBFrvmNib1eq/JkjyKKYuEhoNxgJamxPkaVxXXq3/q8Bt838WUjDkVvuiU66 HAjzLSxWAR7wTt3NDsWhCJ9fwxaLrhNi5sOGFvAT5Sag3FcgwhdeFymEtOXjvN/tTZ9Zog 1KseAEpSPZdE2UEuXmVWOfnYbiOXRQqm0jwzvLiprrS83BLchA7nU7cse6NVlq30cXsaAw QWRFqUgFmrTZkAgtH447TSU/U253Of1YP57tOdxC/TkWzycsDTGWG++aGR/VqPpFUdwzhn p6OcD5IgKxhOpnIE1plwlNm16/XSeHqVALpiX7NxKjcc3dumK1YJ2OQFC7yZ3A== ARC-Authentication-Results: i=1; relay.mimecast.com; dkim=none; dmarc=none; spf=pass (relay.mimecast.com: domain of salt@panix.com designates 166.84.1.89 as permitted sender) smtp.mailfrom=salt@panix.com Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-93-jUUNT37sPb2CyQ1cuSUKJA-1; Fri, 27 Mar 2020 19:19:07 -0400 X-MC-Unique: jUUNT37sPb2CyQ1cuSUKJA-1 Received: from panix2.panix.com (panix2.panix.com [166.84.1.2]) by mailbackend.panix.com (Postfix) with ESMTP id 48pyV262NqzrLH for ; Fri, 27 Mar 2020 19:19:06 -0400 (EDT) Received: by panix2.panix.com (Postfix, from userid 20196) id 48pyV24VhFz1ZTq; Fri, 27 Mar 2020 19:19:06 -0400 (EDT) Date: Fri, 27 Mar 2020 19:19:06 -0400 To: Linux for blind general discussion Subject: Re: Convert unwrapped paragraphs to hard wrapped paragraphs when there's no blank lines. Message-ID: <20200327231906.GA19889@panix.com> References: <20200327142702.35209f95@bigbox.attlocal.net> MIME-Version: 1.0 In-Reply-To: <20200327142702.35209f95@bigbox.attlocal.net> Authentication-Results: relay.mimecast.com; dkim=none; dmarc=none; spf=pass (relay.mimecast.com: domain of salt@panix.com designates 166.84.1.89 as permitted sender) smtp.mailfrom=salt@panix.com X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02RNJC5n024833 X-loop: blinux-list@redhat.com From: Linux for blind general discussion X-BeenThere: blinux-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: blinux-list@redhat.com List-Id: Linux for blind general discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2020 23:19:12 -0000 The following assumes a newline at the end of each paragraph. The PERL script below will put a blank line after each unwrapped paragraph, which in text is just one long line terminated with a newline. Put the perl script in your ~/bin/ directory in a file named doublespace and chmod it to 755. Next, the following command will break an unwrapped paragraph into 75 character lines: fold -sbw 75 Now put the two together: cat $1 | doublespace | fold -sbw 75 Put the above command into ~/bin/dscat, chmod it to 755 and you can do: dscat unwrapped_file > double_spaced_file Now here's the perl script: #!/usr/local/bin/perl # Double space the standard input. Expects a text file. while() { chomp $_; if ($_ eq "" or $_ =~ /^ *$/) { print "\n"; } else { print "$_ "; } } On Fri, Mar 27, 2020 at 02:27:02PM -0500, Linux for blind general discussion wrote: > On March 27, 2020, Linux for blind general discussion wrote: > > does anyone know a way to automate inserting blank lines before > > and after each line in a file that's too long to fit on the screen > > all at once and then hard wrap those long lines? > > Well, since adding a blank line after each line-break puts a blank > line before the next line, you (should?) only need to add newlines > after each line which can easily be done with sed: > > $ sed G input_file.txt > output_file_with_spaces.txt > > If you want to format the lines at the same time, you can do that > with "fmt" > > $ sed G input.txt | fmt > formatted_output_with_spaces.txt > > By default, fmt formats to 72 characters wide but you can adjust that > using > > fmt -80 > > Hope this helps, > > -tim > > > > _______________________________________________ > Blinux-list mailing list > Blinux-list@redhat.com > https://www.redhat.com/mailman/listinfo/blinux-list -- Rudy Vener Website: http://www.rudyvener.com