How can I do this? (InputStreamReader)

Right now I have an array of URL's in a for loop and I want to sort through the html that goes through the InputStreamReader. My problem is that the stuff in the html isn't always the same. Here's some of the html that I need from one of the pages:
<a href="./?page=userinfo&id=9210&div=csi">George Zywiel "Rav"</a>(WonID: 2501550)
<br><a href="./?page=userinfo&id=31242&div=csi">Edward Cheung "tone-"</a> (WonID: 1635415)
<br><a href="./?page=userinfo&id=49410&div=csi">edwin keung "monkey"</a> (WonID: 979492)
<br><a href="./?page=userinfo&id=52854&div=csi">Matt Wilson "Wookie"</a> (WonID: 2093298)I used pretty much the same method to get the URLs I need into the array, but I just used substring to pick out the addresses from the html, because the html was always the same length. The problem with this, is that the link, persons name, and WonID can be any length. I need to get the WonID into a string. I was thinking I could use something like
string = line.substring(line.length()-20)and then sorting through it a charactor at a time until it hits the letter 'W' or something, but there must be a more effeciant way to do this. Any idea's? I'm stuck on this one.
    for (int k = 0; k<calTeamsURLArray.length; k++) {
      try {
        URL teamURL = new URL("http://www.caleague.com/" + calTeamsURLArray[k]);
        BufferedReader teamIn = new BufferedReader(new
          InputStreamReader(teamURL.openStream()));
        while ((line = teamIn.readLine()) != null) {
          strI = Integer.toString(k);
          GUI.txtWonId.setText(strI);
          if (line.substring(x,x).equals("WonID:")) {  //??
      } catch(Exception vv) {
    }

Got it working great now, but I don't understand why it cuts off the last person from each page. It cuts it off from the code you gave me.
        while ((line = teamIn.readLine()) != null) {
          strI = Integer.toString(k);
          GUI.txtWonId.setText(strI);
          int wonIdPosition = line.indexOf("WonID: ");
          if (wonIdPosition >= 0) {
            wonId = line.substring(wonIdPosition + 7, line.length() - wonIdPosition - 1); //Works perfect but cuts off end of code
            calTeamCodeArray = wonId.split("WonID: ");
            for (int z = 0; z<calTeamCodeArray.length; z++) {
              int wonIdCodePos = calTeamCodeArray[z].indexOf(")");
              GUI.txtWonIdResults.append(calTeamCodeArray[z].substring(0,wonIdCodePos) + "\n");  //Takes off code after the WonID
            GUI.txtWonIdResults.append("\n");
        }Here are the results I get from 2 of the pages using the code above:
669210
2572462
1458434
2344938
1371425
3062042
0115304372207
436068
2202973
62879
1641786
117799
2884364
872854Which is perfect, except that there should be one more ID at the bottom of both of them. Without the substring you can sort of see what it's doing:
while ((line = teamIn.readLine()) != null) {
          strI = Integer.toString(k);
          GUI.txtWonId.setText(strI);
          int wonIdPosition = line.indexOf("WonID: ");
          if (wonIdPosition >= 0) {
            wonId = line.substring(wonIdPosition + 7, line.length() - wonIdPosition - 1);
            calTeamCodeArray = wonId.split("WonID: ");
            for (int z = 0; z<calTeamCodeArray.length; z++) {
              int wonIdCodePos = calTeamCodeArray[z].indexOf(")");
              GUI.txtWonIdResults.append(calTeamCodeArray[z] + "\n");  //Took off the substring so it shows tags after the ID.
            GUI.txtWonIdResults.append("\n");
        }Here are the results of the code without the substring:
669210)<br><a href="./?page=userinfo&id=45181&div=cso">David Yuen "RaMpAgE"</a> (
2572462)<br><a href="./?page=userinfo&id=48385&div=cso">Blake Twigge "SUB"</a> (
1458434)<br><a href="./?page=userinfo&id=54331&div=cso">Michael Ramirez "BLixX"</a> (
2344938)<br><a href="./?page=userinfo&id=84847&div=cso">Josh Roussel "Jolt"</a> (
1371425)<br><a href="./?page=userinfo&id=95830&div=cso">Enrique MOreno "kiKi"</a> (
3062042)<br><a href="./?page=userinfo&id=108488&div=cso">richard anderson "thirdeye"</a> (
0115304372207)<br><a href="./?pa
436068)<br><a href="./?page=userinfo&id=40375&div=cso">James Borregard "Blackfyre"</a> (
2202973)<br><a href="./?page=userinfo&id=42803&div=cso">daniel makaveli "David Hasselhoff"</a> (
62879)<br><a href="./?page=userinfo&id=51610&div=cso">Rich VanMarter VanMarter "reese"</a> (
1641786)<br><a href="./?page=userinfo&id=51623&div=cso">Jeremy Clooney "CloonGoon[aTm]"</a> (
117799)<br><a href="./?page=userinfo&id=95066&div=cso">Matthew McNamara "Alchemeron"</a> (
2884364)<br><a href="./?page=userinfo&id=97032&div=cso">Nathan Bugosh "freek"</a> (
872854)<br><a href="./?page=usI don't see how it's choosing where to be cut off, or why it's even being cut off in that area. Any idea's?

Similar Messages

  • When i double click itunes it doesn't open it just comes up with an error saying " The itunes library.itl file cannot be found or created. The default location for this file is in the 'itunes' folder in the 'music' folder". How can i fix this?

    When i double click itunes it doesn't open it just comes up with an error saying " The itunes library.itl file cannot be found or created. The default location for this file is in the 'itunes' folder in the 'music' folder. How can i fix this problem?

    Anyone can help to advice how to solve this issue ?

  • I have 3 different itunes accounts and would like to combine them into just one for all my devices, a macbook pro, an iphone 4S, an older IPOD, and a ver sion one Ipad. how can i do this on all devices ?

    i have 3 different itunes accounts and would like to combine them into just one for all my devices, a macbook pro, an iphone 4S, an older IPOD, and a ver sion one Ipad. how can i do this on all devices ?

    i had one for a long time, then when i got the ipad i didn't realize they would all still work under one so i set up the second one on that
    then when i got the new iphone i put in the info for the first and main one from my mac pro and it would not work at all, and i knew it was right, then it asked me to create a new one or i couldnt finish the setup
    hence why i have 3 now
    hard to believe you cannot combine into one
    oh well, i will just make them all accessible for all 3
    thanks

  • HT204053 I use my iMac to help a friend with an IPAD and a different Apple ID to transfer their existing cps to iTunes on their iPad.  How can I do this without the content being merged into my own Apple ID Account

    I have an IMac which is my main computer and two IPads and an Ipod Nano.
    Obviously we use these in sync as an when required via Itunes.
    I have recommended a friend to have an IPAD2 and she wishes to load some of her existing cds into her Itunes Account.
    If I wish to do this with my own, it is simple as we simply use the Imac which transfers content into Itunes.
    However, my friend does not have a separate computer so I wish to load her CD's into Itunes and then sync to her Ipad without interfering with my own library and using her Apple ID.
    How can I achieve this?

    " how can I sync my iphone to my mac book without losing all the music and pictures on it?"
    You cannot.  Copy everything you want form the old computer to the new one, then sync it.
    it basically says you have to erase your iphone to sync to a new itunes!
    Correct Iphone will sync, or manually manage, with one and only one computer/library at a time. Syncing, or manually managing, to another will indeed erase the current content.

  • HT1296 I already have an itunes account on my laptop but have been setup on a mac and have songs that have not been purchased from the itunes store, I cannot get the songs from my iPhone onto my itunes account on the mac. how can I do this?

    I already have an itunes account on my laptop but have been setup on a mac and have songs that have not been purchased from the itunes store, I cannot get the songs from my iPhone onto my itunes account on the mac. how can I do this?

    You copy them from your old computer or your backup copy of your old computer.
    The iphone is not a backup/storage device.

  • How can I put my mp3 files into my iTunes library? Every time I download a song from a website and try to drag it to my library, it won't add on. How can I fix this?

    Back then when I had the older update with iTunes i never had this problem with trying to put my mp3 files of music into my iTunes library. Now it doesn't want to be put into the library. Once I try to drag the music file to the iTunes library nothing happens, it just keeps showing a cancellation sign with my mouse. So how can I fix this?

    Hi William.
    The problem is probably that the index is corrupt and you need to completely re-create it rather than rebuilding individual mailboxes. I have no idea what the situation really is now after having tinkered with the contents of ~/Library/Mail/, though, so the following procedure may or may not work.
    Verify/repair the startup disk (not just permissions), as described here:
    The Repair functions of Disk Utility: what's it all about?
    After having fixed all filesystem issues, if any, and making sure that there’s enough space available on the startup disk (a few GB, plus the space needed to make a backup copy of the Mail folder), try this:
    1. Quit Mail if it’s running.
    2. In the Finder, go to ~/Library/Mail/. Make a backup copy of this folder, just in case something goes wrong -- e.g. by dragging it to the Desktop while holding the Option (Alt) key down.
    3. Locate Envelope Index and move it to the Trash. If you see an Envelope Index-journal file there, delete it as well.
    4. Open Mail. It will tell you that your mail needs to be “imported”. Click Continue and Mail will proceed to re-create Envelope Index -- Mail says it’s “importing”, but it just re-creates the index if the mailboxes are already in Mail 2.x format.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder, i.e. ~/Library is the Library folder within the user’s home folder.

  • Me and my mom share the same itunes account, everytime i download a app it goes to her phone automattically as well, how can i stop this?

    me and my mom share the same itunes account, everytime i download a app it goes to her phone automattically as well, how can i stop this?

    Open itunes
    Connect her iphone.
    Go to the apps tab.
    Uncheck the box that says automatically sync new apps

  • My Outlook/iCloud calendar invites to others appear to work on my end and sync with my PC and mobile, but when other people "accept" the invite, it will not populate/add in to their calendar. How can i fix this without turning off iCloud?

    My Outlook/iCloud calendar invites to others appear to work on my end and sync with my PC and mobile, but when other people "accept" the invite, it will not populate/add in to their calendar. How can I fix this without turning off iCloud?
    I am at a new office that uses Outlook (not Outlook Exchange) which does not sync with my mobile... I just got iCloud set up on my PC to sync my contacts, calendar, reminders, etc... The sync worked (not without flaws, but the other issues seem solvable... I think), so that i can now see all my appointments on both my phone and on my PC. The problem I am having is that iCloud moved all of my calendar items from Outlook into iCloud calendar and now when I send out meeting/calendar invites the recipients may accept them, but the meeting does not get added to their calendar. This is a huge problem and may mean that i need to turn off iCloud.
    Does anyone know how to fix this?
    Thanks!

    I am replying to my own post here as I seem to have fixed the problem.
    I do have some calendars that are shared. Some of those are shared with users who have time zone support turned on. So i activated time zone support on my iphone, then deleted my icloud subscription. I then signed in to icloud again and voila... problem solved.
    It is a weird one as the other calendar views were always fine and when you opened an event that appeared in the wrong day (on list view), the correct date of the event was shown in the information...
    one more bug in a complicated system I guess

  • My 2009 iMac freezes and won't run more than one application at a time - how can I fix this?

    Help! My iMac has been getting worse regarding freezing, especially when trying to open iPhoto. It will load slowly, and then I get the pinwheel of death for ever, until I shutdown and try over again. It usually takes several tries, and usually overnight. How can I resolve this issue?

    First, back up all data immediately, as your boot drive might be failing.
    Step 1
    This diagnostic procedure will query the log for messages that may indicate a system issue. It changes nothing, and therefore will not, in itself, solve your problem.
    If you have more than one user account, these instructions must be carried out as an administrator.
    Triple-click anywhere in the line below on this page to select it:
    syslog -k Sender kernel -k Message CReq 'GPU |hfs: Ru|I/O e|find tok|n Cause: -|NVDA\(|timed? ?o' | tail | open -ef
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key.
    The command may take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear.
    A TextEdit window will open with the output of the command. Normally the command will produce no output, and the window will be empty. If the TextEdit window (not the Terminal window) has anything in it, stop here and post it — the text, please, not a screenshot. The title of the TextEdit window doesn't matter, and you don't need to post that.
    Step 2
    There are a few other possible causes of generalized slow performance that you can rule out easily.
    Disconnect all non-essential wired peripherals and remove aftermarket expansion cards, if any.
    Reset the System Management Controller.
    Run Software Update. If there's a firmware update, install it.
    If you're booting from an aftermarket SSD, see whether there's a firmware update for it.
    If you have a portable computer, check the cycle count of the battery. It may be due for replacement.
    If you have many image or video files on the Desktop with preview icons, move them to another folder.
    If applicable, uncheck all boxes in the iCloud preference pane. See whether there's any change.
    Check your keychains in Keychain Access for excessively duplicated items.
    Boot into Recovery mode, launch Disk Utility, and run Repair Disk.
    If you have a MacBook Pro with dual graphics, disable automatic graphics switching in the Energy Saverpreference pane for better performance at the cost of shorter battery life.
    Step 3
    When you notice the problem, launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Activity Monitor in the icon grid.
    Select the CPU tab of the Activity Monitor window.
    Select All Processes from the View menu or the menu in the toolbar, if not already selected.
    Click the heading of the % CPU column in the process table to sort the entries by CPU usage. You may have to click it twice to get the highest value at the top. What is it, and what is the process? Also post the values for User, System, and Idle at the bottom of the window.
    Select the Memory tab. What value is shown in the bottom part of the window for Swap used?
    Next, select the Disk tab. Post the approximate values shown for Reads in/sec and Writes out/sec (not Reads in andWrites out.)
    Step 4
    If you have more than one user account, you must be logged in as an administrator to carry out this step.
    Launch the Console application in the same way you launched Activity Monitor. Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Select the 50 or so most recent entries in the log. Copy them to the Clipboard by pressing the key combinationcommand-C. Paste into a reply to this message (command-V). You're looking for entries at the end of the log, not at the beginning.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some personal information, such as your name, may appear in the log. Anonymize before posting. That should be easy to do if your extract is not too long.

  • When I update my nano ipod I get an error message "User ipod cannot be updated.  The disk couldnot be read from or written to."   How can I overcome this error message.

    In the iTunes window, when I update my nano ipod, I get an error message "User ipod cannot be updated.  The disk could not be read from or written to."   How can I overcome this error message.

    Hello there dilip77707,
    It sounds like you are getting this error message that your iPod cannot be read from or written to when you are trying to update your iPod Nano. I recommend the troubleshooting from the following article to help you get that resolved. Its pretty straight forward, just start at the top and work your way down as needed:
     'Disk cannot be read from or written to' when syncing iPod or 'Firmware update failure' error when updating or restoring iPod
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • My wife's nano no longer is recognized by Windows but my ipod touch is?  How can I fix this?

    My wife's nano no longer is recognized by Windows but my ipod touch is?  How can I fix this?

         My iPod touch is always recognized by my Vista Box...using the same USB cable and port my wife's nano isn't detected anymore.  Since Vista can't see the nano iTunes can't see it either.  When I try my wife's nano I get the message:
         "One of the USB devices attached to this computer has malfunctioned, and Windows doesn't recognize it.  For assistance in solving this problem, click this message"
         I thought her nano wasn't charged enough but I've charged it for hours and this doesn't make a difference.  It used to synch like my ipod touch but it stopped working about a week ago.  My wife's nano still holds songs and works it just can't be recognized by Windows.  I even checked if the Apple Mobile Device app was running and it was and I stopped it and restarted it.  Didn't make any difference.  Any ideas?

  • My child accidentally rented a movie on Apple TV.  Is there a way to refund the rental if we don't watch it?  How can I prevent this from happening?  Is there a way to password protect future purchases?

    My child accidentally rented a movie on Apple TV.  Is there a way to refund the rental if we don't watch it? 
    How can I prevent this from happening?  Is there a way to password protect future purchases?

    Did you try Parental Controls?
    Apple TV: Understanding Restrictions (parental controls) - Apple Support
    See if that does the trick: I think there's a way for you to request a password for purchases, but still be logged in.

  • Adobe CR 6.7 does not install into CS5, how can I get this installed to view CR files?

    Just installed CS5 onto new computer. Adobe bridge and CS5 do not recognize CR format. How can I get this installed. I have tried up dating and downloading the CR6.7 update, but can not get it to install. What do I do?

    Product updates

  • I have a private Adobe ID and I have a Lightroom Testversion running there! Now my university gave me access to Creative Cloud for Teams and I want to use my Lightroom catalogues with this ID! How can I do this?

    I have a private Adobe ID and I have a Lightroom Testversion running there! Now my university gave me access to Creative Cloud for Teams and I want to use my Lightroom catalogues with this ID! How can I do this?

    Hi,
    thank you, it’s done! The Chat helped me! Now I cannot go into this forum anymore with my old password, but that’s not a big problem.
    Best wishes,
    Christian
    Von: JimHess <[email protected]<mailto:[email protected]>>
    Antworten an: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Datum: Montag, 20. April 2015 18:38
    An: Christian Kogler <[email protected]<mailto:[email protected]>>
    Betreff:  I have a private Adobe ID and I have a Lightroom Testversion running there! Now my university gave me access to Creative Cloud for Teams and I want to use my Lightroom catalogues with this ID! How can I do this?
    I have a private Adobe ID and I have a Lightroom Testversion running there! Now my university gave me access to Creative Cloud for Teams and I want to use my Lightroom catalogues with this ID! How can I do this?
    created by JimHess<https://forums.adobe.com/people/JimHess> in Photoshop Lightroom - View the full discussion<https://forums.adobe.com/message/7454915#7454915>

  • Every time I go to loge in icloud it sends me a message tha t free creating emails has reach the maximum how can I reset this?????

    Every time I go to log in I cloud it tells me that my phone has reaches the maximum free account uses!!!!!!!!!!!!how can I reset this?????

    Have you had a look at this?
    iCloud: Mailbox size and message sending limits

  • My itunes library is empty but i want to upgrade my ipod without losing my music. how can i do this? please someone HELP!!!

    i recently got a new laptop so my itunes library is empty but i want to upgrade my ipod without losing my music. how can i do this? please someone HELP!!!

    but i got music from my old laptop and my little brothers laptop so basically its no way i can take whats already on my ipod and put it on my computer and drag and drop it to my new itunes library

Maybe you are looking for

  • PostalOne Set Sch Induction Date and Time in Business Objects

    We are running Presort 8.00c, and our printer just told us that PostalOne will not run unles we have Set Sch Induction Date and Time set with parameters.  Where in Business Objects is this information coming from?  I am trying to find this informatin

  • Should custom icons for USB appear on other Macs?

    I have a custom icon for my flash / usb drive that doesn't appear in other Mac computers. The default icon appears. I haven't been able to test it on another Leopard Mac. Is this regular behavior or not? Is there a way to make other Macs show it? I l

  • Not included in the podcast direcotry - why?

    Hi there, I submitted my first podcast to iTunes but it wasn't accepted. I checked all my settings (using podpress in wordpress) and tried to re-submit it but itunes says it's already been submitted. am i blocked forever? what was wrong with my podca

  • Problems installing NW04 sneak preview (java)

    hi, when i run the SAPinst.bat, the status window SAPinst opens up and says this: "SAPinst is getting started. Please be patient ... guiengine: call to bind() for socket 632 failed. No such file or directory ERROR      2005-08-11 22:55:00 [iaxxgenimp

  • Need to create a workflow approval. I need a Acrobat Pro or Acrobat Pro Extended?, which one?

    I need to create a workflow for approval. But i've downloaded and executed acrobat pro trial and i don't see: commentaries=send a PDF for approval. I only saw commentaries=send a PDF for reviews. Has Acrobat Pro the approval option or just Acrobat Pr