HP3000-L Archives

October 2002, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Danny van Delft <[log in to unmask]>
Reply To:
Danny van Delft <[log in to unmask]>
Date:
Tue, 1 Oct 2002 05:32:22 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (22 lines)
 In article <[log in to unmask]>, "Gregory.Stigers"
<[log in to unmask]> wrote:

> I assume that this is a simple problem that someone here has already
> solved... Receiving a record on an Wintel platform, record can vary in
> length, and are of course terminated with CRLF. What the next step
> requires is that these same records be space filled to the end of a
> fixed record length, and still terminated with CRLFs. Sounds like it
> ought to be pretty simple, but with More Than One Way To Do It.
>

Not sure why you'd want to do all this, but something like:

perl -l -p -e 'BEGIN{$\ = $/ = "\r\n"}{$_ .= q( ) x (80-length)}'


should do the trick. Reads and writes from/to stdin/stdout, pads with
spaces to 80 (and won't complain if input is longer than this).

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2