• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

counting support count

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there are long string like following in the text file:
76890 012374 213745
768 098 781
091 712 87
............
............
i have used string tokenizer to obtain individual string,now i have to obtain support count of say integer 7,which is the number of string that contains it,also if 7 occurs multiple times in a single string or more than one times in multiple strings of a line than it accounts to 1 only in it's
support count,ex:
line 1 of above text file contains:
76890 0172374 213745
this line gives support count of 1 of number 7,the support count of integer 7 after all the lines of above text files are read has to be 3.

can any one tell me the logic of doing this in java


thanks and reagrds
puneet
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not really sure what you are requiring, however, from your description, if teh text file has a regular format, then I would look at using the regual expressions (reg ex) that Java supports, to help me out with this.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic