The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
egrep krao UNIX for Dummies Questions & Answers 4 07-03-2008 11:13 AM
Egrep risshanth UNIX for Dummies Questions & Answers 2 06-26-2008 08:21 AM
help on egrep arund_01 Shell Programming and Scripting 2 05-13-2008 02:26 PM
Egrep cheat sheet anywhere? Looking for meaning of egrep -c leelm UNIX for Dummies Questions & Answers 2 01-11-2008 03:37 PM
help with egrep akDBA UNIX for Dummies Questions & Answers 9 08-02-2006 06:33 AM

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 07-26-2008
krao krao is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 16
help on egrep

HI,

I have two files filea, fileeb


filea
z283110z67
xx65686377
xx654681zz
xx652836xx
xx653881zz
xx65480z11
xx654z5466
xx65510000
xx65670000
xx656z0000
xx656z1822


fileb
z283110z67
xx65686377
xx654681zz
xx652836xx
xx653881zz
xx65480z11
xx654z5466
xx65510000
xx65670000
xx656z0000
xx656z1822
xx65370000
xx65182733
xx653z0000
xx652z36xx
xx65676377
z245330104
z245330530
z283241265
xx657136xx
xx651z81zz
xx645xx555
xx65260z11
xx65xx6377
xx654z0000
xx65265466
xx65z00000
xx65266377
xx656xx555
xx65720000
xx6516z110
xx65140000
xx65167288
z245333z77


i want to grep the contents of fileb which are not present in filea

i tried following code

egrep -vf filea fileb > filec

but segmetation error is coming and a core file is getting dumped

Pls help me

count of filea is 255418
count of fileb is 401099
  #2 (permalink)  
Old 07-26-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,777
fileb minus what is in filea
Code:
awk ' FILENAME=="filea" { arr[$0]++ }
        FILENAME=="fileb" { if ( ! $0 in arr) {print $0}' filea  fileb
  #3 (permalink)  
Old 07-26-2008
Vi-Curious Vi-Curious is offline
Registered User
  
 

Join Date: Jul 2008
Location: Texas
Posts: 129
You could also use a combination of sort and comm. Your egrep looks fine so I would assume it just can't handle such a large data set.
  #4 (permalink)  
Old 03-17-2009
krao krao is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 16
above awk code is not working, pls help me
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 09:54 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