CrazyEngineers
  • munishguptamg

    munishguptamg

    MemberMar 8, 2014

    Program to sort data of file in java?

    i have three files among which i have stored the following information:
    ---------------------------------------------------------------
    File1.txt contains following:

    101 Harry Amritsar Punjab

    ---------------------------------------------------------------
    Flie2.txt contains following:

    102 Max Chandigarh Punjab
    101 Mac Panchkula Haryana
    ---------------------------------------------------------------
    I want to pick data from both files and save them into a third file File.txt in soorted order.
    the sorting can be by Id or by Name
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Anoop Kumar

    MemberMar 8, 2014

    You need to create map first with ID or Name with line number and then sort this map.
    After that again read the file extract the data from that line number put in a different file.

    How to read a specific line in file. see this
    #-Link-Snipped-#
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register