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
Finding out how long a script runs for and exit reason. daydreamer Shell Programming and Scripting 2 01-28-2009 05:32 PM
Free Linux Memory by Dropping Caches Neo Linux 0 11-29-2008 11:29 AM
Sed command dropping last record in File bheeke Shell Programming and Scripting 5 09-11-2008 03:41 PM
why my script stopped- any reason(urgent please) krishna9 Shell Programming and Scripting 1 05-21-2008 11:55 AM
strintercept dropping message on unixware kapilverma_udr UNIX for Advanced & Expert Users 2 05-31-2005 04:47 AM

Reply
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 3 Weeks Ago
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,301
Assuming the length of a record is 77 you can do something like:

Code:
awk 'length < 77 {$0 = $0 "0000000000000000000000           NM X"}1' file > newfile
  #2 (permalink)  
Old 3 Weeks Ago
binlib binlib is offline
Registered User
  
 

Join Date: Aug 2009
Location: New Jersey
Posts: 58
The result of the "cmp -l" looks like:
Code:
899  40  60
900  40  60
901  40  60
If you are missing records, it is most likely that the differences will not have a 40 (space) in the second field. Thus
Code:
cmp -l infile outfile |awk '$2 != 40' |head
would give the approximate locations of the missing records.
Reply

Bookmarks

Tags
awk, ksh

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 07:53 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