I want to combine 2 files and and put together in 1 file [ only 2 fields ($4 and $5 in FILE A, $2 and $3 in FILE B) are the common thing between the two files]. See below desired output. Any help will be much appreciated.
FILE A
X 2134 101L 12345.00 22222.00 1 10
X 2134 101L 12345.00 22222.00 11 20
X 2134 101L 12345.00 22222.00 21 30
X 2134 111L 77777.00 22222.00 1 10
X 2134 111L 77777.00 22222.00 11 20
X 2134 111L 77777.00 22222.00 21 30
X 2134 121L 56347.00 46678.00 1 10
X 2134 121L 56347.00 46678.00 11 20
X 2134 121L 56347.00 46678.00 21 30
........
Welcome to forums, please use code tags for complete Input_file and sample outputs into posts as per forums rules. Here are some points which are not clear into your request.
I- Number of lines into filea and fileb are NOT same, so how comparison should happen?
II- IN case it should be by filea's $4 and $5 and fileb's $2 and $3 (as per your post) then also there is a question, let's say we have following scenario where same values of $4 and $5 have more than one values into it then which value we should print?
It is advisable to please describe your requirement little more with sample Input_file and expected Output_file. Anyways based on few wild assumptions following you could take as a startup for this problem.
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.
Please review the rules, which you agreed to when you registered, if you have not already done so.
More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.