I am trying to compare the text strings separated by a delimiter (e.g. ,)of two separate files. The comparison is based on the first value of each of these files. I am thinking of using two separate vectors (also considering arraylist for this matter) to hold each line from these 2 files. Let me just illustrate what I like to achieve -
Jiju's post was onto something important. For each key - the initial 0, 1, 2 in your input - gather up the lines that match. He changed your input format a bit, which you may not be able to do. See if this simplified version makes sense:
Is parsing a string new to you? See indexOf and substring(). String.split() or StringTokenizer might look tempting, but they won't help you split on the first comma and preserve the other commas.