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
What the command to find out the record length of a fixed length file? tranq01 UNIX for Dummies Questions & Answers 9 12-04-2008 04:04 PM
how to convert Fixed length file to delimited file. satyam_sat Shell Programming and Scripting 7 04-03-2008 02:41 AM
Manipulating a fixed length file w/o PERL dabear Shell Programming and Scripting 4 03-31-2008 04:33 PM
use SQL loader to dump a fixed length file in to DB anumkoshy Shell Programming and Scripting 2 10-10-2007 05:53 AM
convert XML file into Text file(fixed length) ram2s2001 Shell Programming and Scripting 0 11-03-2005 01:28 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-25-2003
cmanand cmanand is offline
Registered User
  
 

Join Date: Nov 2003
Posts: 1
Wink existing file to a fixed length file

I want to copy a existing file to a fixed length file. Thanks , I used awk getline and infuntion mode was using 0 as end of file. and length to give but the programs comes out without doing anything

I need the help
CM
  #2 (permalink)  
Old 11-26-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Code:
#! /usr/bin/ksh
typeset -L70 line
while read line ; do
     echo "$line"
done
exit 0
  #3 (permalink)  
Old 11-27-2003
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,407
You could use awk...
Code:
awk '{printf "%-70s\n",$0}' infile > outfile
  #4 (permalink)  
Old 01-25-2008
nvenkat010 nvenkat010 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 3
Adding spaces

Hi,

My questions goes in the same line. rather i want to print spaces in a trailer record which i generate as a single command.

namely the trailer command

recs=`wc -l $TargetFileDir/myfile.txt|cut -c1-9`;export recs;echo 'PCPC.DXDINPT.FC0.INPUTFLE.PASS'`date +%Y%m%d``printf '%015d\n' $recs` >> $TargetFileDir/myfile1.txt

I wanted add a filler of say 200 spaces. Is there any awk can be used??
Sponsored Links
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 03:33 AM.


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