Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: merge 2 csv files

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default merge 2 csv files

    Hi,

    any one can help me to solve this issue.

    Have 2 files File1.csv and file2.csv containing some values. Have to read both files and write unique values in to another file.
    in the new the there must be unique rows and not duplicate rows(2 files contain some rows same)
    What is the best approach for doing this?


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,287
    My Mood
    Mellow
    Thanks
    252
    Thanked 777 Times in 762 Posts

    Default Re: merge 2 csv files

    Welcome! Please read this topic to learn how to post code correctly and other useful info for new members.

    Read every line in each of the two files
    Store the data from the two files into one collection
    Sort the collection
    Locate and mark duplicate entries
    Write unmarked entries to the 3rd file

  3. #3
    Junior Member
    Join Date
    Feb 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: merge 2 csv files

    i need java code for that

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,287
    My Mood
    Mellow
    Thanks
    252
    Thanked 777 Times in 762 Posts

    Default Re: merge 2 csv files

    I see. Since you began this thread to obtain code and not help coding, I'm closing it. Come back and start another when you have code - your own - and need help with it.

Similar Threads

  1. Inventory CSV files
    By mstratmann in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: December 25th, 2013, 12:26 AM
  2. Merge 20+ xml files with 7000+nodes into one using java
    By mija in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 3rd, 2013, 03:33 AM
  3. Eclipse Merge Two Files
    By aussiemcgr in forum Java IDEs
    Replies: 0
    Last Post: June 8th, 2012, 02:36 PM
  4. Reading CSV files into a program
    By Wrathgarr in forum Java Theory & Questions
    Replies: 2
    Last Post: April 15th, 2010, 11:41 AM
  5. Merge 2 Sorted Text Files into a Third
    By Epyllion in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 10th, 2010, 08:24 PM