fl command - set record length | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


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

fl command - set record length

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-14-2006
Tom Siegel Tom Siegel is offline
Registered User
 
Join Date: Jul 2006
Last Activity: 16 August 2006, 4:06 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #2  
Old 07-17-2006
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
 
Join Date: Apr 2004
Last Activity: 24 October 2014, 2:07 AM EDT
Location: Bordeaux, France
Posts: 1,711
Thanks: 2
Thanked 61 Times in 57 Posts
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.
Sponsored Links
    #3  
Old 07-17-2006
Tom Siegel Tom Siegel is offline
Registered User
 
Join Date: Jul 2006
Last Activity: 16 August 2006, 4:06 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks !!!!!
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Make variable length record a fixed length jclanc8 Shell Programming and Scripting 3 10-03-2009 08:24 PM
awk to find the length of each record. mac4rfree Shell Programming and Scripting 0 08-20-2009 09:22 AM
Check length of record DebianJ Shell Programming and Scripting 5 08-06-2009 03:19 PM
What the command to find out the record length of a fixed length file? tranq01 UNIX for Dummies Questions & Answers 9 12-04-2008 03:04 PM
AWK record length fix kanu_pathak Shell Programming and Scripting 4 10-08-2008 03:28 PM



All times are GMT -4. The time now is 04:29 AM.