My very last problem:)

Ok. here we go again I guess..
I got this table. which data I save in txt file "hello.txt".
Each CellData is put in there seperated by an |
example:
(columns are: name, country, score)
Bush, George|United States|0|Kennedy, John F.|United States|1|Blair, Tony|United Kingdom|15|
now I need a function or anything which can read these data a part from each other, read Bush, George, then reads, United States, then reads 0.
in this function it also needs something like this:
o=1
i=0
while (there is more info in hello.txt) {
if (i != 3) {
read first word
table.setValueAt(FirstReadInfo,1,0)
int i + 1
table.setValueAt(SecondReadinfo,1,1)
int i + 1
table.setValueAt(ThirdReadInfo,1,2)
i=0 (reset while statement)
addRow()
now my question is:
How to read word by word seperated by |
How to see if there is more info in txt file.
this really is the last thing for my project:)
Thanks so much for all youve done so far.
Thanks again for whats coming

You could try a Scanner as below....
import java.io.*;
import java.util.*;
public class ScanFar {
    public static void main(String[] args) throws IOException {
        Scanner s =
            new Scanner(new BufferedReader(new FileReader("farrago.txt")));
            s.useDelimiter("|\s*");
        while (s.hasNext()) {
            // enter your code here
            System.out.println(s.next());
        s.close();
}Or a regular expression might be better in that you could trap all three elements at once
Pattern pattern = Pattern.compile("([^|]+)|([^|]+)|([^|]+)");
Matcher matcher = pattern.matcher(your input string);
while(matcher.find()) {
            match.group(1); // this is the first ( ) or the name
            match.group(2); // this is the second ( ) or the city
            match.group(3); // this is the thrid ( ) or the score
        }

Similar Messages

  • TS2516 an error occurred uploading my iPhoto Book order. It puts the book together and starts to send but at the very last moment comes up with an error message. but checking the book in iPhoto there are no problems to be found.

    an error occurred uploading my iPhoto Book order. It puts the book together and starts to send but at the very last moment comes up with an error message. but checking the book in iPhoto there are no problems to be found.

    This user talked to Apple Support personnel and confirms what Larry is suggesting:
    crowland1066
    Re: book upload fails
    Nov 30, 2013 3:02 PM (in response to pablo123)
    Just got off the phone with apple support.  If the photo book completes the assembly process but fails during the upload process the problem is in their overloaded servers.They just started a free shipping promotion for the holidays which has increased the traffic dramatically. I bought a calendar a week ago and it went right through. I'm going to try again during less peak times.
    Happy Holidays

  • Dear Sir/Mam, I am writing you because of facing a problem in my ipod. I have downloaded wechat a month a go and then deleted later on, but last night I needed wechat again so i try to download it but the very astonishing problem occurs in downloading tha

    Dear Sir/Mam,
    I am writing you because of facing a problem in my ipod. I have downloaded wechat a month a go and then deleted later on, but last night I needed wechat again so i try to download it but the very astonishing problem occurs in downloading that. In apple store when i search wechat there is written open on it right side instead of free or install. I become so much astonished that if i don't have wechat in my ipod apps then how it become written open on it....?????? i just tap that open but its nor opening neither downloading.....
    I am so much worried about that problem because i need wechat badly....
    Please help me as soon as possible....

    If you are getting the 'open' option on the Purchased tab in the App Store app then that implies that you still have the app installed - you've checked all of your iPod's homescreens and app folders for it, and tried searching for it via its spotlight search screen (swipe your first homescreen to the right) ? Do any of those find it, or if you tap on the 'open' button does that open the app ?

  • Apple Banned me, because of a very weird problem with my "Factory Unlocked"

    Hi Everybody! Im having a very weird problem with my unlocked iphone 4.
    First of all, i would like to apologize because of my english, is not very good. My native language is Spanish.
    Well.. Im from Mexico, and here we can buy the iphone Unlocked on the Apple Online Store.
    Here's my problem. Apple has exchanged my iphone 3 times.
    I returned the iphone the first time because the screen was totally yellowish, other than that everything was working great!, that was by the end of September.
    On October 20th, i recieved my second iphone, and then a bigger problem started .
    Before i continue, let me give you this information: here in Mexico we have basically 3 cell phone companies
    1.- Telcel
    2.- Movistar
    3.- Unefon
    OK, now on october 20th, i recieved my second iphone, and then procced to activate via itunes using my UNEFON sim card (microsim).
    And every time i tried to activate it, only got this message onscreen:
    http://i148.photobucket.com/albums/s2/jorgelomeli/Screenshot2010-10-29at24915PM. png
    I though something was wrong with my brand new factory unlocked iphone 4.
    I have 4 more simcards from my brothers (they all had iphone 4 too)
    I tried telcel sim card, and i could activate my iphone. Then i insterted the Movistar microsim, and it worked too!! But then when i put the Unefon sim, the itunes logo inmediatly appears on the screen asking to activate on itunes, and when i tried that, the only response i got was the image above saying " The Simcard inserted on this iphone does not appear to be supported"
    Weird thing here is, that, when i put my Unefon sim card on my brothers iphone 4, it worked great! on all of them, internet 3g, phone, wireless , evrything!
    I called apple support, and they exchange the iphone for another one.
    I recieved the third iphone on October 29. Last friday. and guess what? SAME PROBLEM! different serial number, same week production (week 42) but exactly the same message on itunes.
    Very, very frustrated, i called apple again, and after 1 hour with thechnical support, they told me " We are sorry, but we can only offer you, your money back, NO MORE EXCHANGES FOR YOU"
    I said why?... i dont want my money back! i want an UNLOCKED iphone!, but they refuse to give me another iphone.
    When i asked techincal support, why my unefon sim card worked great on all three of my brothers iphone but not on mine, he just told me, "I really dont know, i guess they just got lucky" ****, this answer put all my trust i had on apple products for years, right on the garbage.
    Since they refused to give me another iphone, i accepted my money back, and inmediatly after i finished the call, i asked my brother to buy me one more time an iphone 4 using his name, and his credit card. Now i have to wait until November 8-12 to recieve my new iphone, hoping this time i get a REAL UNLOCKED iphone, and not a partially unlocked iphone.
    btw. i even went to Unefon costumer service and bought a new prepiad line, with a new microsim, just to be 100% sure that this problem is not because of the sim. And again didnt worked on my iphone, but it worked on any of my brothers iphone4.
    Serial numbers of the 3 iphones:
    79039C0U* (this one worked great with Unefon, only problem was yellow screen)
    85042GR4*
    81042FJB*
    What do you suggest me? any info would be really aprecciated
    FYI i also restore 4 times the last iphone and nothing seemed to work, i use 3 different computers, Macbook Pro, iMac, and an Hp with Windows 7, and the same message on all three computers.
    Wierd thing also, one of my brothers bougth an iphone 4 this last week too, but he bought the 16Gb not the 32Gb. His iphone production week is 42 also! and when i put my Unefon sim in his iphone works great!
    I dont know what else i can do, I just need to have faith that my new iphone coming this november will be real unlocked, but what if i'll recieve an iphone and then the same problem?? time for android? just kidding really guys, what can i do? anyone with similar problem like me? i dont wanna use Telcel or Movistar, i wanna use Unefon, and thats why i bought an Unlocked iphone
    btw: jailbreak is not a solution for me, because i always like to use legal software on all my apple products, and because of the warranty.

    According to http://support.apple.com/kb/HT1937, there are two official carriers in Mexico (Movistar and Telcel) and neither carrier offers an unlocked phone.

  • Very annoying problem since 1-2 years with "AllSport GPS" app and e-mail "terror" - please help!

    Hi there,
    I have a very annoying problem that occurs since 1-2 years. Now I want to get finally rid of this.
    I bought the app "AllSport GPS" via BlackBerry App World in 2010. After the uninstallation of this app due to new devices one or two years ago I have the following problem:
    On each (!) update of my list in the BlackBerry World app or after the reset and reload of the content of installed app I receive 1-5 (different amount) of mails with the following content:
    AllSport GPS license key for your BlackBerry
    Thank you for purchasing AllSport GPS from BlackBerry App World.  The license key for your device is:
    XXXXXXXXXX
    This is VERY annoying! I also informed the publisher of the app (Trimble Outdoors) but they told me to contact BlackBerry. During the last 1-2 years - because I often refresh and look after new updates for my apps (I have many installed on my device) - I received, no fake, hundreds (!) of this annoying mails!
    I bought the app with my older 9700 or 9790. In the meantime, on my Bold 9790, the app is not available any longer for this, so it is not shown in my BlackBerry World environment. In this case I could make a new clear installation and deletion of the app. But this is not possible.
    It would be great if anybody of BlackBerry is reading this and could reset or delete the resending of this mail.
    Are there other other thay also have this problem? Any suggestions?
    Greetings from Germany
    Daniel

    Actually, this is a user-to-user forum. There are some BlackBerry employees who read these posts, but in most case you are only talking to other BlackBerry users.
    So to solve your question, you will need somebody from BlackBerry, as most other users will not really be able to solve the problem. If you contacted BlackBerry Support, I guess the best thing is to wait for their answer. You can try tweeting to @BlackBerryHelp, in some cases they can reply to you faster. Or you can have their attention much faster.
    I find it weird myself that you haven't contacted them before, as you say the problem is since a couple of years now.
    I am afraid that you will not receive a lot more information on this forum (as this is a rather specific problem in my opinion). Except maybe if one of the BlackBerry employees on this forum notices this post.
    I hope your problem is solved soon!
    A like is always appreciated,
    but a nomination for BB Elite even more :-)
    You can also contact me on Twitter: @ndsmyter

  • Very strange problem facing

    Hello All,
    I am facing very strange problem from last a week.
    I have made flex application using Flex3 and AMFphp.
    I was running very fine but just from before 7 days, my all images will not displayed in Mozilla Firefox browser.
    but it is running fine in Internet Explorer browser.
    any idea? I have tried to know what happen but i failed.
    Please help me to identify what's going wrong.
    Thank you.

    Have you tried emptying your cache?
    Dany

  • PLEASE HELP!! I've used iWeb to create multiple sites, all published to third party servers.  The very last site I made changes to is showing up in any domain file I open - despite their different names and locations on my iMac.  I just switched to Lion.

    Please HELP!!  I just switched to Lion.  I have created multiple websites using iWeb  3.0.4 and despite my having saved their 'domain' files in various locations and using different filenames, upon opening the domain files I keep getting the very last site I published.  All the sites were published to third party servers.  The domain files (still have a preview that look correct and have different file sizes) but keep going back to the last site published. HELP ME PLEASE!! Are the old files still available?!!

    In Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    To open your domain file in Lion or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    You can download an already compiled version with this link: iWeb Switch Domain.
    Just launch the application, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder.  So rename your domain files once they've been created to something other than the default name.
    OT

  • TS1559 My iPhone 3GS will not now join wifi.  This is a very recent problem and I have tried everything so hope someone can help.  I go Settings then Wifii, it picks up network no problem but then does not download IP Address.

    My IPhone 3GS will not now join wifi, this is a very recent problem.  It finds my network but does not download the IP Address hence when I load password Join remains grey.  I have tried all the fixes suggested I.e.  network reset, airplane on then off but still nothing.  I also have another iPhone of the same type and an iPad and they are just fine so I know it is not a router problem.  Please please what do I do?

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • A very Strange Problem!!!help me!!

    i encounter a very strange problem, in EJB
    i write two EJB, one Stateless Session called A, and one Entity called B.
    i want to call B's findByPrimaryKey method in one A's Business, but failed!!!
    but when i remove the statement that performed the findByPrimaryKey method to A's setSessionContext method, It's Success!!!!!
    what the Problem, i am useing the Borland 's AppServer.
    who can help

    how u create the entity bean B from A?
    using proper lookup?
    can u try by write a small function inside bean A
    that contain proper lookup to Bean B...
    then try to call finbyPrimaryKey...
    now tell me is it working?
    or else can u give code or clear idea..
    if i can help u ,,,, sure i will
    do mail me
    [email protected]

  • Very Simple Problem-- Need help in method selection process

    Hello,
    It's difficult to explain the background of the program I am making-- but I am stuck at a very simple problem, that I can only solve with a very long block of if statements:
    I have 3 possible numbers-- 1, 2, or 3.
    Imagine two numbers are already taken-- say 1 and 2. I want a variable to set itself to the number that's not taken (3).
    So, again: If two numbers were taken say 2 or 3-- I want the variable to be sent to the other one that isn't taken-- 1.
    Thank you for your help,
    Evan.

    Actually, I'll just tell you the context of the program-- here is what I have so far:
    This program is meant to simulate Monty Hall Problem:
    http://en.wikipedia.org/wiki/Monty_Hall_problem
    The program sets up an array of three possible values. Each one of those values represents a door with either a goat or a car behind it. It then randomly sets one of those values to 1 (in order to represent a car as per the Monty Hall problem), and 0's represent goats.
    The user, which is simulated by the program (does not involve actual interaction), chooses a door initially.
    The game show hosts then reveals a door that is not the users initial choice, but IS a goat ( an array value of 0).
    For example if the array was [0][0][1]
    The user could pick door one (array position 0). Which is a goat.
    The game show host then reveals a goat that is not the users choice-- which would be array position 1.
    After the game show host reveals the goat-- I want the user to always switch his decision to the only other remaining door that was not his first choice.
    Then I wanted the computer to test to see if his final choice is the one with a car. And to tally up the amount of times he got it right.
    --Sorry that was long winded:
    import TerminalIO.*;//imports TerminalIO package for system.out.println
    import java.util.*;//import java.util for random
    public class Monty_Problem
         int doors[]= {0,0,0};
         Random rand= new Random();
         double wins,totals=0;
         public void carAssignment()
              int car_door= rand.nextInt(3);
              doors[car_door]=1;
         public int judgesChoice(int judgeDoor, int initialChoice)
              if(judgeDoor != initialChoice && doors[judgeDoor]!=1)
                   return judgeDoor;
              else
                   return judgesChoice(rand.nextInt(3), initialChoice); //infinite loop right here that I cannot remedy.  I want the program to have the judge pick a location that is not occupied by a  '1' and is not the user's choice. 
         public void gamePlaySwitches()
              int initialChoice= rand.nextInt(3);
              int judgeDoor = 0;
              int secondChoice= 0;
              judgeDoor= judgesChoice(rand.nextInt(3), initialChoice);
              //This part is meant to have the user switch choices from his initial choice
                   // to the only other choice that hasn't been revealed by the judge. 
              while(secondChoice == initialChoice || secondChoice== judgeDoor)
                   secondChoice++;
              if(doors[secondChoice]==1)
                   wins++;
                   totals++;
              else
                   totals++;          
         public static void main(String [] args)//creates the main menu
              Monty_Problem a= new Monty_Problem();
              int games=0;
              while(games!=100)
                        a.carAssignment();
                        a.gamePlaySwitches();
                        games++;
              System.out.println(a.wins/a.totals);
    }Edited by: EvanD on Jan 11, 2008 4:17 PM

  • TS1135 Cannot process the Photo Book; it fails always at the very last stage with "error occurred while uploading on of your files. Pls check your network connection and click Retry..." Tried at 12 times and no joy!  Can anyone help?

    Can anyone help with the Photo Book process?  I have tried at least a dozen times and the Photo Book always fails at the very last stage of the process.  I ordered Buy Book, it assembles the book and files are transferred until the very last moment... it says " An error occurred while uoloading one of your files.  Please check your network connection and click Retry to resend your files."   It fails every time, any advice?  My server is TalkTalk which may explain everything !! ??   Help.

    Boot into Safe Mode, Mac OS X: Starting up in Safe Mode, and order from there. 
    Also make a PDF file of your book according to this Apple Document, iPhoto '11: Preview a book, card, or calendar before you order or print it, before you order to check for errors.  Keep that file to compare with the printed copy when it arrives.
    OT

  • A very strange problem in netbeans

    i debug a project in netbeans,a a very strange problem happens.
    a member variable was different between wtk20 and wtk22.and the variable was changed many places so it's hard to trace!
    but there hasn't the problem when i debug project in jbuilderx!

    My problem is, even I've written the SQL in the correct syntax, in my java code, it just look like this
    adc.SQL("insert into test(subject, content) values('" + sf.filter(subject.getText()) +"'"
                                  + "," + "'"
                                  + sf.filter(board.getText()) + "')" );
                                  subject.setText("");
                                  board.setText("");
    where subject is a textfield and board is a JTextArea and sf is a string filter which use regular expression, I basically want to insert the string in these component into the database, Many strings work, but client for updates can't be inserted.
    With my best,
    Zike Huang

  • Last problem in my project!!

    i've intend to open this 'Receipt.class' by clicking button from other class file called 'Main.class'
    Normally we used this statement "Receipt open = new Receipt();" to open,
    but what if the class file is like that??
    Please help me even giving me the clues!! please.. this is my last problem in my project!!!
    import java.awt.geom.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.print.PrinterJob;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.print.*;
    public class Receipt extends JPanel implements Printable, ActionListener {
    final static JButton button = new JButton("Print");
    public Receipt() {
         setBackground(Color.white);
    button.addActionListener(this);
    init();
    public void actionPerformed(ActionEvent e) {
    if (e.getSource() instanceof JButton) {  
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if (printJob.printDialog()) {
    try {
    printJob.print();
    catch (Exception ex) {
    ex.printStackTrace();
    public void paintComponent(Graphics g) {
         super.paintComponent(g);
         Graphics2D g2 = (Graphics2D) g;
         drawShapes(g2);
    public void drawShapes(Graphics2D g2){
    g2.drawString("Hello world",50,50);
    public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
    if (pi >= 1) {
    return Printable.NO_SUCH_PAGE;
         drawShapes((Graphics2D) g);
    return Printable.PAGE_EXISTS;
    public void init{
         JFrame f = new JFrame();
         JPanel panel = new JPanel();
         panel.add(button);
         f.getContentPane().add(BorderLayout.SOUTH, panel);
         f.getContentPane().add(BorderLayout.CENTER, new Receipt());
         f.setSize(580, 500);
         f.show();

    I don't quite get your question. What did you mean by open? Did you mean to display it. Receipt is a JPanel, to show it you need to have it inside a Frame or an Applet or some sort of container.
    try this
    import javax.swing.*;
    Receipt receipt = new Receipt();
    JFrame aFrame = new JFrame("Display Receipt Panel"); //create a JFrame
    aFrame.getContentPane().setLayout(new BorderLayout()); //set Layout Manager for the frame
    aFrame.getContentPane().add(receipt, BorderLayout.CENTER); //add panel to the frame
    aFrame.show(); //show the frameThe above block of codes create a JFrame and add the Receipt panel to the Frame. Then call the Frame to show. You can put this code in a method, if you need to use this Frame and panel again, make them instance variables rather than local variables.

  • Very Urgent - Problem in showing JPopupMenu using 1.4 plugin

    Hello ,
    I have a very different problem with JPopupMenu. I have developed a new PopupMenu extending the MetalComboPopup used by the MetalComboBoxUI. I have registered with the JPopupMenu for the callback methods popupMenuWillBecomeVisible && Invisible(). I have an applet which instantiates (3 instances) my JComboBox. When I run the applet using the JDK1.4 plugin, when I click the second JComboBox, the first and the second JComboBox's popups appear at the same time. I am unable to suppress the popup (i.e Only one popup should appear at a time).
    Can anybody help me out in this issue.
    If you have a solution you can email to me -> [email protected] /
    [email protected]
    Thankx in advance,
    SS

    Did you try changing the driver then?
    Please use Oracle's thin driver instead of the oci driver.
    There are many advantages of using the type 4 driver. the first and foremost being that it does not require oracle client side software on your machine. Therefore no enteries to be made in tnsnames.ora
    The thin driver is available in a jar called classes112.zip the class which implements the thin driver is oracle.jdbc.driver.OracleDriver
    the connection string is
    jdbc:oracle:thin:@<machine name>:1521:<sid>
    please try out with the thin driver and let me know.
    regards,
    Abhishek.

  • Nokia 3250:A very strange problem...

    hi..i'm facing a very strange problem in my handset 3250.. i've upgraded its os but still there is problem: http://discussions.europe.nokia.com/discussions/bo​ard/message?board.id=smartphones&;message.id=9102#M9102 any idea about such type of problem.....

    MR.,
    what is firmware?? How can i have its latest edition??
    Can you help me because i too have the same problem:
    Problem 1:
    1-I install any software (e.g:snake game) through Application manager (Pc Suit) in memory card.
    2-I launch that software (snake game) just after installation it works properly.
    3-Now i switch-off the hand set and than switch-on it.
    4-I try to launch that software (snake game) again but it doesn't response.
    Problem 2:
    1:There is a image in my Memory card.
    2: I set that image as a wallpaper.
    3-Now i switch-off the hand set and than switch-on it.
    4-Wallpaper reset to default one.
    Problem 3:
    1-I install a theme through Application manager (Pc Suit) in memory card.
    2: I apply that theme in my hand set.
    3-Now i switch-off the hand set and than switch-on it.
    4- Now theme reset to default one.

Maybe you are looking for

  • Single line plan, how to switch and question about what rep told me.

    I just got a contract (9/3) and have the "more everything plan" - I called Verizon Cust. Care (9/4) to inquire about the single line plan, I was told by Matthew that the single line plan price is in addition to the 40.00 line surcharge, so it would b

  • ITunes Match won't recognize albums bought in another country as purchased

    Hi all, momentarely I'm quite dissapoibted with iTunes match. I have a library with 26k titles - over 2'700 bought in iTunes, the rest is my digitalized CD-Library or bough via amazon. in 2010 I moved from germany to switzerland and changed the count

  • How do I sort photos by camera model?

    HappyNew Year all! I have photos from 4 cameras in Aperture. Each a different model, and since 2 of the cameras belong to my son and daughter, I'd like to sort their photos into a different folder and export them off my Mac, and onto theirs. So how t

  • Oracle 8i database cache

    I have installed cache as part of installation of IAS. I have also configured cache orgin database. When i am trying to cache the table of origin database, it is giving the following error: 'Caching table LEARN.DEMON on cache ora_9i-cache ... ERROR:

  • ME55 DUMP error after EHP upgrade

    Hi all, We recently upgraded to SAP ECC EHP7 version (Basis 740) and we are getting some kind of dump error upon entering ME55. Is this a common issue? I could not find the same issue noted before. How can I resolve it? I attached the error screen th