Results 1 to 4 of 4
Hello all,
I have a perl question. I need to remove the lines from 1 file that have a string matching a line on a different file, I could write ...
- 02-10-2010 #1Just Joined!
- Join Date
- May 2009
- Posts
- 9
Perl Search/Replace between 2 huge files
Hello all,
I have a perl question. I need to remove the lines from 1 file that have a string matching a line on a different file, I could write a script with sed or grep, but one file is 200 mb and the other one is 6 mb... just imagine.
Here is the example:
200mbfile:
key1X,fild2,fild3,fild4,fild5
key1C,fild2,fild3,fild4,fild5
key1V,fild2,fild3,fild4,fild5
key1B,fild2,fild3,fild4,fild5
key1N,fild2,fild3,fild4,fild5
6mbfile:
keyC
keyB
Having this said... I need to create a new file with data from 200mbfile that is not key'd on the 6mb file... example:
key1X,fild2,fild3,fild4,fild5
key1V,fild2,fild3,fild4,fild5
key1N,fild2,fild3,fild4,fild5
Any Ideas? I was trying to do a foreach loop, but I was sugested to use hashes instead, but still, cant figure out how to do this effectively, any help is appreciated!
Regards,
OCON
- 02-12-2010 #2Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )
- 02-12-2010 #3Just Joined!
- Join Date
- May 2009
- Posts
- 9
Hello!
I was wondering why I didn't got any reply before... it was a typo... well things were more complicated but I am just about to figure it out, just having some issues with a regexp, but I am almost done.
Thank you for pointing that out; and of course, for replying!
Ocon
- 02-12-2010 #4
regular expression you say? this tool has saved me so much time. i recommend it for all.
RegExr: Online Regular Expression Testing Toollinux user # 503963


Reply With Quote
