in reply to merging 2 files to one problem

What have you done so far? You should divide the task into smaller tasks, then it becomes manageble:

1. Reading in file 1. Use split() to get at the single values of the line. I would recommend storing the data into a hash (or probably a HashofHashes or HashofArrays). Yes, that is not easy for a beginner, but there is a lot of documentation in perl books or on the net how to handle complex strucutures like HashofHashes and HashofArrays. For example http://perldoc.perl.org/perlreftut.html

2. Reading in file 2. If you can process each line separately, call a subroutine with each line that does the processing (again to divide the task). If not, storing into a hash might be best to group together all lines with the same key.

3. Merging. Loop through each key of one the files and check out any corresponding data in the second file. Compare, sort and output to a third file. Use subroutines to divide the task into small steps.

Sorry for the very general advice, but you left out so much information about your problem we could give you hundreds of different solutions that would all match your problem description and still would not be what you want. Also this is not a code-for-hire website, we help, but we want to see some effort from your side too.

Replies are listed 'Best First'.
Re^2: merging 2 files to one problem
by kjsunny (Initiate) on Mar 23, 2010 at 14:29 UTC
    Thanks for your answer. I want to solve that problem by my self. but Frankly, on no coding expirence. that's too difficult to me. but your advice is very helpful to me. Thank you very much.