• 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

File I/O - How to do?

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to read from a file and then write to a file.
The input file looks like following :
07200608240190200105,WA07MA44,K
07200608340190200105,WA07MA37,K
07200608240190200105,WA07MA34_P2, K
07200608240190200105,WA07MA34_P1,K
07200608440190200105,WA07MA32,K
07200608340190200105,WA07MA31,K
07200608640190200105,WA07MA30_P2,K
07200608240190200105,WA07MA30_P2,K
07200608540190200105,WA07MA28_P2,K
07200608840190200105,WA07MA28_P1,K
07200608240190200105,WA07MA20_P2,K
07200608240190200105,WA07MA20_P2,K
07200608340190200105,WA07MA18,K
The Output should be :
The total Number of records in the input file : < the total number of records > -- In our case it should be 13
The number of unique values in the first column : This case it should be 6
The number of unique values in the secind column : This case it should be 11
I am cluseless about how to achieve this.Anybody please help me with the idea and/or code.
Thanks,
Chris.

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post your code. Just the file reading and writing parts of it.
AJ
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please don't post the same query in multiple forums - it wastes the time of people who don't realize that a question has already been answered. Since there are already several responses to this in "Java in General - Intermediate", I'll close this thread. Followups can go to Intermediate.
 
Always look on the bright side of life. At least this ad is really tiny:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic