what I was trying to do is to compare each line of file1 with each line of file2, not just match each other.
That is not clear. How is "compare" different from "match"? What do each of those terms really mean, for your purposes? Show a couple examples of data from each file, and what sort of output you want with regard to those examples.
Might there be duplicate lines within a given file? Do you need to keep track of the particular positions in one or both files when there is a "match" (or some particular result of "comparison"), or will it be enough just to list the data that matches/compares? Do you need to preserve or enforce a particular ordering in your output?
If the files are "very huge", then it will be very important to be very clear about what you are really trying to accomplish; having the wrong task in mind, and/or using the wrong approach, can waste a "very huge" amount of time. |