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 2 of 2

Thread: Filtering help

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Filtering help

    Hi all!

    Im a really beginner in java.

    I whant to make a java console application with this attributions:
    I have one input and one output file.
    I whant the output file to contains only once the line group what the input file contains repeatedly.
    So for example:

    Anna is tiwce in this file in input. I whant to output file contains the Anna once with BEGIN:VCARD to END:VCARD

    Input file contains this lines:

    BEGIN:VCARD
    VERSION:3.0
    N:;András Pestkó;;;
    FN:András Pestkó
    TEL;TYPE=CELL:+363044000000
    END:VCARD
    BEGIN:VCARD
    VERSION:3.0
    N:füred;Anita;;;
    FN:Anita füred
    TEL;TYPE=VOICE:+36203100000
    END:VCARD
    BEGIN:VCARD
    VERSION:3.0
    N:;Anita füred;;;
    FN:Anita füred
    TEL;TYPE=CELL:+36203100000
    END:VCARD
    BEGIN:VCARD
    VERSION:3.0
    N:;Anna;;;
    FN:Anna
    TEL;TYPE=VOICE:+36204800000
    END:VCARD
    BEGIN:VCARD
    VERSION:3.0
    N:;Anna;;;
    FN:Anna
    TEL;TYPE=CELL:+36204800000
    END:VCARD
    BEGIN:VCARD
    VERSION:3.0
    N:;Anna;;;
    FN:Anna
    TEL;TYPE=CELL:+36204800000
    END:VCARD
    BEGIN:VCARD
    VERSION:3.0

    Thanks for helping me.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Filtering help

    Is the data small enough that it will all fit in memory?
    Read data, save data for each "ID", discard any duplicates, write out new file from saved data.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Filtering microphone sound
    By badoumba in forum Java Theory & Questions
    Replies: 0
    Last Post: April 28th, 2012, 08:02 AM
  2. Java help, passing/filtering a array
    By jack55655 in forum Collections and Generics
    Replies: 21
    Last Post: September 3rd, 2011, 11:43 AM