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*

5
  • It is not clear to me. Do you want to see of any of the lines of file2 occur anywhere in file1, or do you want to compare them row-wise. Commented Jun 3, 2014 at 10:04
  • The simplified version of your script would be grep -f file2 file1 Commented Jun 3, 2014 at 10:11
  • Are both files ~400,000 lines, or just file1? What is the approximate number of unique elements in file2? Are they really strings like aac,xyz (i.e. a maximum of ~26^3 unique strings)? Commented Jun 3, 2014 at 12:24
  • @bernhard i want to see any of lines of file2 occur in column1 of file1.if it so then i need to write it to a file . Commented Jun 3, 2014 at 14:29
  • Both are 400000 lines . @steeldriver Commented Jun 3, 2014 at 14:30