• Post Reply Bookmark Topic Watch Topic
  • New Topic

Scanner and SortedSet

 
harrell collins
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using a scanner to scan a text file and write out three fields to another text file. I need to sort the file based on the taxID and a deeper sort based on classcode. if the taxId is the same and the classcode is different then I need to increment the counter and print the line. If taxId and classcode is the same I simply need to put the acctNo in an array to be printed later. I am including my code. Any suggestions or help is appreciated.
 
Jean-Francois Briere
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should do it in two passes.
First read the file and add all mail elements in the tree set.
Second iterate over the tree set to write to the second file.

Regards
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!