How can i remove the integer and the double in the TREESET in java?

can anyone help me?
import java.util.*;
import java.io.*;
public class assign1
     public static void main(String [] args)throws Exception
          TreeSet oldaccs = new TreeSet();
          TreeSet curraccs = new TreeSet();
          TreeSet newaccs =new TreeSet();
          TreeSet gradaccs = new TreeSet();
     try
               readAccounts("oldAccounts.txt", oldaccs);
               readAccounts("currAccounts.txt", curraccs);
          catch(IOException ioe)
               System.out.println("Cannot open file");
               System.exit(1);
          //Newacc
          newaccs.addAll(curraccs);
          newaccs.removeAll(oldaccs);
          PrintWriter p = new PrintWriter(new FileWriter("newAccounts.txt"));
          Iterator it;
          it = newaccs.iterator();
          while(it.hasNext()){
          p.println(it.next());
           String str;
           str="!NA";
           while(it.equals(str))
                     p.println(it.next());
          p.close();
          //gradAcc
          gradaccs.removeAll(curraccs);
          gradaccs.addAll(oldaccs);
          PrintWriter q = new PrintWriter(new FileWriter("gradAccounts.txt"));
          Iterator it2;
          it2 = gradaccs.iterator();
          while(it2.hasNext()){
          q.println(it2.next());
          q.close();
     public static void readAccounts(String filename, TreeSet accs)
                    throws IOException
          Scanner sc = new Scanner(new FileReader(filename));
          String accName;     
          while (sc.hasNext())
               accName = sc.next();
               accs.add(accName);
}// end of classit will auto create a 2 text file and auto write the result to the txt file but i just need the name. Below is the gradAccounts.txt output:
1.89
1.98
2.00
2.21
2.33
2.34
2.44
2.49
2.56
2.67
2.76
2.78
2.88
2.89
3.00
3.10
3.23
3.33
3.43
3.44
3.50
3.67
3.76
3.79
3.88
4.00
Amenda
Boby
Brandon
CGPA
Cathy
Clark
David
Garry
ID
Jacky
Jasmine
Jimmy
Jonh
Julie
Kevin
Laura
Leo
Marry
Michael
Micheal
Name
Nim
Paula
Peter
Rachel
Rock
Rosetta
S0001
S0008
S0014
S0020
S0023
S0027
S0065
S0076
S0077
S0079
S0092
S0096
S0103
S0105
S0111
S0113
S0120
S0168
S0175
S0184
S0189
S0212
S0260
S0262
S0314
S0317
S0321
S0329
S0406
S0628
Sam
Sharon
Smith
Suki
Susan
Tom

Zclee wrote:
     public static void main(String [] args)throws Exception
I'm going to faint ...
kind regards,
Jos

Similar Messages

  • How can I remove accessibility text and voice over from the logon screen?

    Before I log on to my Mac, in the logon screen I get accessibility text and voice over features enabled all the time. I can remove them by pressing cmd + f5 several times until they're gone (while I'm still in the logon screen). I would like to remove them permanently so that they never appear in the logon screen.

    Can you provide an example? I've been trying (for
    example) "select translate(' test one', ascii(' '),
    'X') from dual" with no luck.
    Thank you.To replace space, you should query like this:
    select translate(' test one', chr(32), 'X') from dual instead of select translate(' test one', ascii(' '), 'X') from dual Thanks,
    Dharmesh Patel

  • I have a new iPad with wifi. When I send messages I can see my sons and my husbands but not my phone number.  We all have an iPad and all use the same apple ID as iPad the bill.  How can I remove their numbers and add mine?

    I have a new iPad with wifi. When I send messages I can see my sons and my husbands but not my phone number.  We all have an iPad and all use the same apple ID as iPad the bill.  How can I remove their numbers and add mine?

    Add another e-mail account to your messages, so people could reach you on that e-mail from messages. As soon as you are online (if you have wifi only iPad) you are able to send and receive messages. i.e. your son can send you a messages from his iPhone addressing it to your (that additional) e-mail address.

  • How can i remove my credit card from app store, the none option its not there and i don't Owen  nothing to apple, my last in app purchase was in clash of clans, please help!!! Because of that problem i cant update my apps! Plz help!!!!!

    How can i remove my credit card from app store, the none option its not there and i don't Owen  nothing to apple, my last in app purchase was in clash of clans, please help!!! Because of that problem i cant update my apps! Plz help!!!!!

    You've logged into your account and viewed your purchase history and there aren't any error messages shown (e.g. 'problem with a previous purchase'), and you haven't got any purchases due (e.g. pre-orders and/or subscriptions) : Why can’t I select None when I edit my Apple ID payment information ?

  • How can i remove iTunes 10.1.0.54 saying the feature you are trying to use is on a network resource...enter an alternate path to a folder contaning the installation package 'iTunes.msi'?

    How can i remove iTunes 10.1.0.54 saying the feature you are trying to use is on a network resource...enter an alternate path to a folder contaning the installation package 'iTunes.msi'?
    < Edited by Host >

    Unfortunately, this sort of trouble has gotten more complicated to deal with ever since Microsoft pulled the Windows Installer CleanUp utility from their Download Center on June 25. First we have to find a copy of the utility.
    Let's try Googling. (Best not to use Bing, I think.) Look for a working download site for at least version 3.0 of the Windows Installer CleanUp utility. (The results from mydigitallife and Major Geeks are worth checking.)
    After downloading the utility installer file (msicuu2.exe), scan the file for malware, just in case. (I use the free version of Malwarebytes AntiMalware to do single-file scans for that.)
    If the file is clean, to install the utility, doubleclick the msicuu2.exe file you've downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove".
    Quit out of CleanUp. Restart the PC, and try another iTunes install. Does it go through properly this time?

  • How can I do to acquire and save date in the same time and in the same file when I run continual my VI without interrupti​on.

    I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
    So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
    Thank you in advance.
    Regards,
    Attachments:
    HP8563E_Query_Amplitude.vi ‏37 KB

    Hi,
    Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
    So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
    I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
    So I want to acquire 1 time amplitude from spectrum analyser each 5
    period of the signal that I am acquiring from parallel port.
    So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
    Here is a new algorithm.
    1) i=0 (counter: number of period)
    2) I read value from In Port
    3) If I acquire a period
    i= i+1 (another period)
    4) If i is multiple of 5 (If I read 5 period)
    acquire 1 time amplitude and write to the same
    file this amplitude and the corresponding distance
    Distance = 12*i). Remember each period of signal
    Corresponds to 12 Inches).i has to take these
    values: 5,10,15,20,25,35,40,45,50,55,60............
    5) Back to 2 if not stop.
    Thank you very much for helping me.
    Regards,
    Attachments:
    Acquire_Amplitude_00.vi ‏59 KB
    Figure_Algorithm.doc ‏26 KB

  • My iPad was stolen, how can I have it blocket and/or send to the iPad a message to get it back

    My iPad was stolen, how can I have it blocket and/or send to the iPad a message to get it back

    If you enabled Find My iPad on it before it was stolen, and if it is still turned on and connected to the internet with Find My iPad enabled, you can do this by going to icloud.com as explained here: http://help.apple.com/icloud/#/mmfc0f0165.

  • How can i use both Windows and Mac os at the same time on my iMac

    How can i use both Windows and Mac os at the same time on my iMac

    You can use Parallels desktop or VM Fusion to run both operating systems at the same time. Both programs work well, but I personally perfer VM Fusion.

  • I had an App on MacBook Air which would cause my computer to be locked. I delted it and reinstalled the App again from the AppStore. Now I am being charged again for the same App. How can I correct this issue and get refund for the double billing?

    I had an App on MacBook Air which would cause my computer to be locked. I delted it and reinstalled the App again from the AppStore. Now I am being charged again for the same App. How can I correct this issue and get refund for the double billing?

    You can't gift it, gifting can only be done from within the store, not from within your library.
    Puchases are considered final but you can try the 'report a problem' link to contact iTunes Support and see if they will refund or credit you : http://reportaproblem.apple.com
    If the 'report a problem' link doesn't work then you can try contacting iTunes Support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • How can I remove all photos and directories from iPhoto?

    How can I remove all photos and directories from iPhoto as if it was a brand new install?
    I am new to iPhoto and was unaware of how it works, honestly I still am a little confused as to when pics I am using 1/2 the time, some from iPhoto and some from MyPics.
    Anyhow, I am looking to remove all photos from iPhoto because during the migration of all my photos from PC to MAC, somehow my timeline became messed up and all my photos that have been logged my dates since 1998 are now all messed up.
    Although all my year folders are still in tact, IE 1998-2006, the subfolders and like pics are all intertwined somehow.
    And when I search iPhoto for a given year, photos from 2,4, 8 yrs back show up in 2006.
    Anyhow, I have selected and deleted all photos and folders within iPhoto, and then import the desired photos from MyPics, only to have the photos double up in the library. ( The old ones that should be deleted and the new imports)
    I simply don't get it, they fill the trash and disappear when it's emptied, then reappear when iPhoto re-opens!
    Can someone help????
    I have completely reworked all my photos so that they are all in the correct folders outside of iPhoto, and now I want to import those and only those pics with that file structure.
    IE Structure = YEAR > MONTH > DAY ( or if needed) > DAY/EVENT

    Do you want to remove the existing full sized image files also? If so then just drag the iPhoto Library folder from the Pictures folder to the Trash and empty it. But be warned you'll lose all of your image files.
    You are dragging the files to the iPhoto Trash bin and then using the iPhoto->Empty Trash menu, right?
    In copying your photos to myspace and then back the original capture date may not be retained and then either the created date or modified date will be used by iPhoto. If the files in the current library are the originals from your camera then those have the best chance of retaining the correct Captured Date. You can check that out by dragging the Originals folder from your iPhoto Library folder to the desktop and then trash what remains of the iPhoto Library folder. Then launch iPhoto and it will ask you to create an new library. Then import that Originals folder and it's subfolders by dragging it into iPhoto's open window. You'll keep the same rolls that was. The roll dates may change but you can check the captured date of the files by using the calendar in the Source pane.
    You won't be able to keep your folder structure within iPhoto. Each outside folder will result in a roll with the same title as the folder. You'll be able to create folders in the Source pane to put albums inside. You can create a smart album to include all photos in a certain date range, line one month.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    G5 Dual Core 2GHz, 2G RAM, 250G HD; G4 Dual 1Ghz, 1.5G RAM, 80G HD,   Mac OS X (10.4.7)   22 LCD Display, 200G & 160G FW HDs, Canon S400, i850 & LIDE 50, Epson R200

  • How can i remove windows 7 and reinstall a fresh copy of windows 7

    how can i remove windows 7 and reinstall a fresh copy of windows 7

    Assuming you installed Windows in a Boot Camp partition, start up Boot Camp Assistant and select the menu item to remove Windows and return the drive to a single partition. Then run Boot Camp Assistant and select the menu item to install Windows 7.

  • How can i remove shared libraries and itunes

         how can i remove shared libraries and itunes account from my iphone to my little brothers itouch if we both share the same itunes?
    he keeps on getting all the apps that i download as well as pictures i was wondering if anyone knows how to fix this problem

    You could either remove the iCloud account altogether and have him create his own or go into settings->store-> and switch automatically download Apps off.  And go into icloud and turn off photostream.  Depends on what you prefer.

  • How can I remove Firefox successfully and allow hyperlinks to work?

    I need to clear space on my PC and wish to remove Firefox. I tried this but then could not open any hyperlinks from e-mails in Outlook. I tried various options suggested on the Outlook help page but to no avail. How can I remove Firefox successfully and allow hyperlinks to work?

    Have you tried resetting your Default Browser back to IE, thru the Control Panel > Add / Remove Programs?

  • HT1918 how can i remove my billing and change it into a free apple id user?

    how can i remove my billing and change it into a free apple id user?

    iTunes Store: Changing Account Information
              http://support.apple.com/kb/HT1918
    Select None under your payment method.

  • How can I remove private browsing as an option on the Firefox Menu? My kids use this computer and I don't want them to be able to private browse.

    I want to remove the Firefox menu option for Private Browsing because my kids and teenagers use this computer. How can I do that? Private Browsing cannot be an option for my children. If I cannot remove it, is my only option to remove Firefox altogether?

    This is new. Read carefully the section "About this Add-on". Not 100%, but there is no real way to totally take PB out of Firefox; that is also the case for other browsers that have a similar feature, as far as I know:
    *https://addons.mozilla.org/en-US/firefox/addon/disable-private-browsing/
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]

  • I synced my phone to my IMac and all my photos transferred. How can I remove them from phone. I need the room on phone.

    Hello, I would like to remove extra images from my phone that were synced from my IMac. What is the best way to move them off the phone and regain my memory space.

    You remove photos that were placed on your computer via an iTunes sync by syncing again. When you sync again, after connecting the phone to iTunes, remove the checkmark in front of "Sync Photos From" on the Photos page of iTunes if you want to remove all previously synced photos or change the selection of folders/albums to be synced if you only want to remove some. Each time you sync, iTunes sets the non-Camera Roll photos on the phone to match the current iTunes settings. More info on iTunes photo sync: http://support.apple.com/kb/HT4236

Maybe you are looking for

  • ITunes became corrupt and crashed my system

    After I updated and installed the latest iTunes, my system crashed and began behaving 'viral'. After running AVG and Spybot S&D a few times each and finding nothing, I restored windows to an earlier known good configuration. Just before doing that, I

  • After Effects Audio Output Causes Render To Hang Then "Output Module Failed"

    So I have been working on this video for a few weeks now, no special effects just 3D layers and text. I had set it to render Thursday afternoon and it finished Friday night after I left work. So today I came into work played the video and I realized

  • Mavericks unstable on macbook pro

    since installing mavericks my mid 2010 macbook pro it is really unstable. Is fixing this in the works ? is there an easy way to uninstall ? I was fine with previous OS arragement thanks.

  • Cannot set 24FPS in Compressor

    Hi I want to burn a 24F DVD and I been following the instructions from here http://www.kenstone.net/fcphomepage/24p_in_FCPnattress.html It says that Compressor will not alter the video file frame rate but i does on mine, my video is shot in 7D, 24fps

  • Tried to restart on os 9, now won't start up at all

    I have an old G4 desktop with OS 9.0. I bought OS 10.4.6 and installed it fine, not erasing the hard drive. I discovered that Classic can't work unless you have 9.1 or preferably 9.2 or later, so I went and downloaded a 9.1 upgrade (intending to late