In one file we have employee number and salary and in another file we have employee number and designation . Now in the output file i want to print salary and designation with corresponding employee number ?
Jump to Post
Probably the fastest way to do that is to read all of file2 into an in-memory array(s). Then start reading file1 line by line. Read a line, search file2 array for employee ID, when found print to third file or to screen. Repeat that for each line in file1.
All 4 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.