Grep -f for big files

ok guys.
this isnt homework or anything.
i have been using grep -f all my life but i am trying this for a huge file and it doesnt work.

can someone give me a replacement for grep -f pattern file for big files?

thanks

Please define/describe doesn't work .
What is it that you're trying to do exactly and in what way it "fails"?

2 Likes

im trying to grep -f patternfile file
both patternfile and file are huge so grep doesnt work here.
ive been reading up that awk is the way out here.

i need a solution for this.
thanks

Don't think we can help you unless you answer the previous question in the detailed way.
Thanks

im trying to

grep -f patternfile file
both patternfile and file are huge so grep doesnt work here.

ive been reading up that awk is the way out here.

Can someone help me with an awk which does the same job as grep -f?
thanks

Can you post sample patternfile and input file?

hi guys.
ok so im working with a huge pattern file Q.
i am trying to split the pattern file Q into 50 files and saving output of grep in file1,file2...etc
the problem is that the output keeps saving in file0.its not saving in file1,file2 etc
can someone help?

i wrote these codes.

let i=0
while read line; do
split -l 50 Q Q.split.
for CHUNK in Q.split.* ; do
        grep -f "$CHUNK" MEGA-CNN-AND-LINKDIN >"file_$i"
  let i+=1
done < "$i"
  done 
done