I have output from an old terminal system that needs to be concatenated. Here is an example of the output.
output1 = LINE ONE LINE TWO LINE THREE NO DATA LINE FOUR LINE FIVE LINE SIX % output2 = LINE FOUR % LINE FIVE LINE SIX LINE SEVEN NO DATA LINE EIGHT END
there may be as many as 5 output strings that need to be joined. Problem ... There may be duplicates among the lines (there are some repeats (ex: NO DATA) that should not be removed), so a simple line comparison is not workable.
correct answer should be: LINE ONE LINE TWO LINE THREE NO DATA LINE FOUR LINE FIVE LINE SIX LINE SEVEN NO DATA LINE EIGHT END
Looking for a java solution.
Any ideas? Thanks.