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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Deleting lines from a file Nirgude07 UNIX for Advanced & Expert Users 11 07-01-2009 03:09 PM
Deleting whole lines from a file red baron UNIX for Dummies Questions & Answers 3 07-07-2008 06:54 PM
Deleting lines inside a file without opening the file toms Shell Programming and Scripting 3 09-24-2007 08:58 AM
Deleting Lines from .csv file 009satya Shell Programming and Scripting 3 11-14-2006 03:41 AM
deleting lines in a log file BG_JrAdmin Shell Programming and Scripting 2 08-22-2006 12:12 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-29-2009
dinesh1985 dinesh1985 is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 31
Question Deleting lines from file using another file

I am having a requirement like
File A contains All the records
eg.,

Code:
ONE
TWO
THREE
FOUR
FIVE
SIX
SEVEN
EIGHT
NINE
TEN

File B contains invalid records of File A
eg.,

Code:
TWO
FOUR
FIVE
SEVEN
NINE

Is there any sed or awk command to be used in shell script to compare files A and B and filtered out only good records in A.

Basically I need to delete all the lines in A which are present in B.
My final A file should be like

Code:
ONE
THREE
SIX
EIGHT
TEN

Can Anyone please help.

Last edited by Yogesh Sawant; 06-29-2009 at 04:49 AM.. Reason: added code tags
 

Bookmarks

Tags
awk, sed, shell, shell scipt, unix

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 09:15 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