I am trying to input data between two files. I have to input on piece of data from the files at a time and then compare them. Once they have been compared I have to ouput them into a new file so that they are in numerical order. Do you have any suggestions as to how I should input these numbers one by one?

Three words: intermediate data structure. For example, read each record from the first file and save it in an array. Then sort the array and write it to the second file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.