The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What the command to find out the record length of a fixed length file? tranq01 UNIX for Dummies Questions & Answers 3 10-19-2007 11:16 AM
Record Length too long -- AWK Problem venkatajay_18 Shell Programming and Scripting 2 03-05-2007 12:15 PM
fixed record length george_ Shell Programming and Scripting 16 03-28-2006 02:41 AM
Parsing a variable length record Barb UNIX for Dummies Questions & Answers 17 10-01-2004 05:37 AM
UNIX Default Record Length in AWK JLandry UNIX for Advanced & Expert Users 1 01-25-2002 06:40 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-14-2006
Registered User
 

Join Date: Jul 2006
Posts: 2
fl command - set record length

Hi,

I have a KSH shell script running on hpux that uses the fl command - ex:
cat /foo | fl 50 > bar

This command will take each record in the file foo, make it 50 characters long and then write it to the file bar. my problem is that I am porting my scripts over to solaris which doesn't suport the 'fl' command.

Any ideas?

Thanks,

Tom
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-17-2006
aigles's Avatar
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,158
On my AIX box :
Code:
newform -l50 -a -b /foo > bar
and for all Unix with awk :
Code:
awk '{printf'"%-50.50s\n",$0)}' /foo > bar
Jean-Pierre.
Reply With Quote
  #3 (permalink)  
Old 07-17-2006
Registered User
 

Join Date: Jul 2006
Posts: 2
Thanks !!!!!
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0