HP3000-L Archives

February 1999, Week 4

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:
Tom Patton <[log in to unmask]>
Reply To:
Tom Patton <[log in to unmask]>
Date:
Thu, 25 Feb 1999 15:40:32 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
How about:

# Replace with tabs:
perl -e 'while (<>) {tr/|/\t/; print; } < oldfile > newfile

#Blank-pad with arbirtrary field width (10 in this example)
perl -e 'use Text::Tabs; $tabstop=10; while (<>) { tr/|/\t; print expand($_);
}' < oldfile > newfile

use all caps for filename, and be sure your in a group if you need the
resulting file to
be visible in mpe namespace. Prebuild the output file and use >>
rather than > if you need special build options for the destination file.

HTH,
-tom

"Stigers, Greg [And]" wrote:

> X-no-Archive:yes
> COBOL. My first COBOL program was on my first job read a (variable record
> length) pipe delimited file, and wrote a fixed record length file,
> UNSTRINGing from the original record to the target record. My second and
> third programs went the other way, STRINGing together the same. I had
> well-defined specs. Although this is a capital offense in some shops, I
> found that not shuttling the records into and out of working storage made
> for a considerable increase in efficiency.
>
> The only 'gotcha' was the discovery that a value that couldn't possibly be
> negative, the quantity of an inventory transfer, almost always was. Turns
> out that in the wild, transfers between stores were keyed by receiving
> store, as a negative quantity. So long as you can get specs from the
> originating platform and be clear on how this is being used, COBOL should
> serve you well.
> ================================
> All progress, all success, springs from thinking - [log in to unmask]
> <mailto:[log in to unmask]>
>
> -----Original Message-----
> From: Stefano [mailto:[log in to unmask]]
> Sent: Wednesday, February 24, 1999 6:22 PM
> To: [log in to unmask]
> Subject: Delimited Files
>
> I have a pipe delimited file that I wish to convert to fix format.
> <snip>

ATOM RSS1 RSS2