Reading a file and displaying the content
I am new to java and I have to read the file of following format


    Ram-Hydrebad
    Ram-Bangalore  
    Ramesh-Chennai
    Ramesh-Mumbai        
    Ram-Delhi

After reading, I need to display the output as follows.

    Ram - Hydrebad, Bangalore, Delhi
    Ramesh - Chennai, Mumbai

Please share your ideas.
Reading a file and displaying the content
===

I am new to java and I have to read the file of following format


    Ram-Hydrebad
    Ram-Bangalore  
    Ramesh-Chennai
    Ramesh-Mumbai        
    Ram-Delhi

After reading, I need to display the output as follows.

    Ram - Hydrebad, Bangalore, Delhi
    Ramesh - Chennai, Mumbai

Please share your ideas.