[HPADM] RE: Script question to make multiple file of fixed rec le n of 255

From: Lodge, David (David.Lodge@capitalone.com)
Date: Fri Sep 12 2003 - 08:19:14 EDT


 
cd /medicaid/prod/edi
for i in *.EDI
do
   awk ' {
      x1=substr($0,1,255);
     print x1;
  } ' $i

-----Original Message-----
From: Lal, Neeraj [mailto:Neeraj.Lal@pfizer.com]
Sent: 11 September 2003 23:19
To: 'hpux-admin@DutchWorks.nl'
Subject: [HPADM] Script question to make multiple file of fixed rec len of
255

Hi Admins

Here is the small question for scripting

In a dir I receive files on daily basis the no of file is not fixed it may
02 or 100 but the file name prefix & Suffix is Standard

Which is PCHC_(-Some unique no-).EDI

Every File has some records with 255 rec length and some records 455 I have
to make all the files of same rec len which is 255.

For a single file I can use the follwing script

awk </medicaid/prod/edi/PCHC_0023.EDI \

'
 {
 x1=substr($0,1,255);
 print x1;
 }
 '

How should I process the multiple file ?

Neeraj Lal
Pfizer Inc.
Consultant CHC-IS
973-385-2734

 
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:33 EDT