Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    I believe it should preserve the order of file b. Commented May 29, 2012 at 23:44
  • when i use grep -F -f 300KFile 30MFile > result.txt it basically recreated the 30MFile in result.txt. Am I doing something wrong? Commented May 30, 2012 at 2:18
  • @marcio_rogerio: It just means almost each line from the 300K file has a match somewhere in the 30M file. In such a case, my script will not help you. Can you give us more information about the data - i.e. is the length of fields constant etc.? Commented May 30, 2012 at 6:42