HP3000-L Archives

October 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:
Glenn Cole <[log in to unmask]>
Reply To:
Glenn Cole <[log in to unmask]>
Date:
Fri, 22 Oct 1999 07:08:57 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
Dick Braun writes:

> I am looking for a utility or some code that will run on a HP3000 that
> will convert a CSV formatted file that originated on a PC and has been
> transferred to the HP3000 into fixed width fields in a fixed length
> record.

As yet another alternative, there was a thread back in February on
this topic.  The subject was "Delimited Files".  Here's the thrust
of a solution I mentioned using the POSIX tool 'awk':

----------------------------------------

Let's say each line of file 'data' has three fields:

        billy|bob|barnes
        jim|joseph|jones

We can get this to print with 8-byte-wide fields

        ....+....0....+....0..
        billy   bob     barnes
        jim     joseph  jones

(minus the template) with:

        awk -F"|" '{ printf( "%-8s%-8s%-8s\n", $1,$2,$3 )}' data

----------------------------------------

You can search the archives at

   http://raven.utc.edu/cgi-bin/WA.EXE?S1=hp3000-l

This is difficult for me to remember, so it may be easier (in general)
to start at

   http://raven.utc.edu/archives/hp3000-L.html

and follow the first link.

--Glenn

ATOM RSS1 RSS2