The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to read record by record from a file in unix raoscb UNIX for Dummies Questions & Answers 1 05-16-2008 07:30 AM
Fill the Key fields : Please help us charandevu Shell Programming and Scripting 11 04-08-2008 10:40 AM
splitting a record and adding a record to a file rsolap Shell Programming and Scripting 1 08-13-2007 02:58 PM
fill a NIL into the blank field happyv Shell Programming and Scripting 8 03-23-2007 04:49 AM
Esc key/Auto-fill mr_manny SUN Solaris 3 10-30-2005 07:12 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-17-2008
JohnMario JohnMario is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 7
Question need to space fill a 2060 byte record

Calling all experts:

When I ftp from Mainframe to unix server, the ftp message says fixed length 2060, but i lose trailing spaces.
I tried a solution i found here,
awk ' { printf("%-2060s\n",$0) } ' fname1 > fname2
works for small records but, err msg: string too long, for long records

Any ideas?
Much appreciated.
  #2 (permalink)  
Old 03-17-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,763
Whenever you deal with mainframe files consider dd

I think you want something like - this assumes the input file has carriage returns (newlines):
Code:
dd ifile=fname cbs=2060 conv=block > fname2
Play around until you get what you want.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0