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
delete n last lines of a file ncatdesigner Shell Programming and Scripting 7 05-17-2008 07:07 AM
delete first 100 lines from a file salaathi SUN Solaris 3 11-15-2007 12:01 AM
delete first 100 lines rather than zero out of file thepurple SUN Solaris 7 11-14-2007 09:35 AM
Delete lines in a file umal Shell Programming and Scripting 6 02-08-2006 09:08 AM
delete all lines in file strok UNIX for Dummies Questions & Answers 6 03-11-2002 06:27 PM

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

Join Date: Apr 2006
Posts: 2
delete the lines from file

i have two files & want to delete the lines from 2nd file which matches with 1st file
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-01-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,323
Try using the comm command. Check the man page for details on which switch to use.
Reply With Quote
  #3 (permalink)  
Old 04-03-2006
npn npn is offline
Registered User
 

Join Date: Nov 2005
Posts: 14
Lightbulb deleting Lines

You can do a diff and then write these records into a new file and delete file2.
then rename it to file2. U need some minor tweaking for this to work.

However, for this the File 1 must be a Master file. It should always contain all the records which could be present in the file2.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:29 PM.


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