Not enough info. Merge by concatenation, by joining records in input order, by joining based on a key value present in both files? Etc?
Formats or examples of both files, and how are they to be merged (or an example output file) would be really helpful here.
JamesCherrill
Posting Genius
6,371 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
OK, no problemo.
Are you looking for a quick'n'dirty way or a good Java object-oriented way?
JamesCherrill
Posting Genius
6,371 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
Read each file into a map (2 files, 2 maps) by extracting the sno to use as key, and put the rest of the line as the value.
When you have the two maps look through all the keys in the first map, and get the corresponding values from both maps. For each key concatenate the key with both values and write that to the output file.
JamesCherrill
Posting Genius
6,371 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073