How do you read in different kinds of data?

Hi
How do you read in integers first and next read in a string of characters?
Please help.
Thanks,
Sincerely,
Egan

You don't give enough information to provide a definitive reply. DataInputStream is Java's IO class that is designed to do that . This reference has example code of how it's used.
http://java.sun.com/docs/books/tutorial/essential/io/dataIO.html

Similar Messages

  • How would you read in each line of data and display them to message box?

    How would you read in each line of data from the _.txt file_ and display the whole data using an information-type message box?
    I know how to display each line of the .txt file data, but I do not know how to display the whole thing.
    Here is how I did to display each line of data using the message box:
    import javax.swing.JOptionPane;          // Needed for the JOptionPane class
    import java.io.*;                         // Needed for file classes
    public class problem3
         public static void main(String[] args) throws IOException
              String filename;          // Needed to read the file
              String categories;          // Needed to read the categories
              // Get the filename.
              filename = JOptionPane.showInputDialog("Enter the filname.");
              // Open the file.
              FileReader freader = new FileReader(filename);
              BufferedReader inputFile = new BufferedReader(freader);
              // Read the categories from the file.
              categories = inputFile.readLine();
              // If a category was read, display it and
              // read the remainig categories.
              while(categories != null)
                   // Display the last category read.
                   JOptionPane.showMessageDialog(categories);
                   // Read the next category.
                   categories = inputFile.readLine();
              // Close the file.
              inputFile.close();
    }I think I need to change here:
    // If a category was read, display it and
              // read the remainig categories.
              while(categories != null)
                   // Display the last category read.
                   JOptionPane.showMessageDialog(categories);
                   // Read the next category.
                   categories = inputFile.readLine();
              }but I don't know how to.
    Could you please help me?
    Thank you.

    kyorochan wrote:
    jverd wrote:
    What is not understood about your question is which part of "read a bunch of lines and display them in a textbox" do you not understand.
    First thing's first though: You do recognize that "read a bunch of lines and display them in a textbox" has a few distinct and completely independent parts, right?I'm sorry. I'm not good at English, so I do not understand what you said...
    What I was trying to say is "How to display the whole lines of .txt file in single dialog box."We know that.
    Do you understand that any problem can be broken down into smaller pieces?
    Do you understand that your problem has the following pieces?
    1. Read lines from the file.
    2. Put the lines together into one String.
    3. Put the String into the message box.
    and maybe
    4. Make sure the message box contents are split into lines exactly as the file was.
    (You didn't make it clear if that last one is a requirement.)
    Do you understand that 1-4 are completely independent problems and can be solved separately from each other?
    Do you understand that you have stated that you already know how to do 1 and 3?
    Therefore, you are NOT asking "How to display the whole lines of .txt file in single dialog box." Rather, you ARE asking either #2 or #4 or both.
    If you say once more "display all the lines of the file in one dialog box," then it is clear that we are unable to communicate with you and we cannot help you.

  • How do you combine 3 different itunes libraries from 3 different computers to one computer?

    How do you combine 3 different itunes libraries from 3 different computers to 1 computer?
    Can you keep it from creating duplicates?  These libraries have some duplicates.
    How do you deal with duplicates? 
    I'm talking 50GB. 
    All computers are authorized. 
    THANKS for any suggestions.

    You can't.
    If accounts could be merged, then everybody could merge their accounts with everybody and there would be no need for anyone to buy anything.

  • How do you read your favorite feeds?

    Hi! This is my very first post on Arch forums.
    I'm wondering about how do you read your favorite feeds? Which software do you use and why (what kind of features).
    I'm more interested in finding a little software that uses the system tray.
    Yet I'm also curious about just how does, those who utilize RSS, do it.
    Personally I've used YARSSR, which is exactly what I want, except for few problems..
    On Ubuntu it used to be as easy as make, make install (having build-essenial installed). On Debian 4.0 stable it is in the stable repos, so it was even easier. On Arch it's not in any of the repos nor AUR and make, make install didn't work:
    # yarssr
    bash: yarssr: command not found
    # /usr/local/bin/yarssr
    Can't locate Gnome2.pm in @INC (@INC contains: /usr/local/lib/yarssr /usr/lib/perl5/5.8.8/i686-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at /usr/local/lib/yarssr/Yarssr.pm line 3.
    BEGIN failed--compilation aborted at /usr/local/lib/yarssr/Yarssr.pm line 3.
    Compilation failed in require at /usr/local/bin/yarssr line 13.
    BEGIN failed--compilation aborted at /usr/local/bin/yarssr line 13.
    I'd love to understand what's going on. How to install it right.
    Anyhow, it's far from perfect anyway. It's the single thing that is not working so perfectly on my Debian as it should. Uses way too much CPU, sometimes stays trying to update and never does update nor allow forced updates, no quitting, etc..
    I also use Google Reader, which is great to read many feeds and manage them, etc.
    All I want is a little applet (maybe GNOME applet?) that gives me quick glimpse of my top favorite feeds, without using my browser nor launching a full-functional aggregator.
    Last edited by UnbreakableMJ (2007-05-24 14:43:38)

    UnbreakableMJ wrote:
    iphitus wrote:
    have used newsgator, planet, own scripts, google reader, akregator, blam, raggle.
    currently using snownews.
    so far, none of them really suit how i want to read my news.
    James
    Hi James.
    I'd like to know how you want to read your news
    i'd prefer a cli frontend, web front would be bonus (river of news style).
    snownews is good, just needs a few tweaks, some ui ones, and the main one being:
    often i dont get to read news for a few days straight, so i'd like something i can put in cron and it'll update, and log the news for a few days straight, so when i get back it's all there. this generally limits me to one of the web clients, i dont know any desktop apps that do this.
    i might write up an app to do this someday
    as for your yassr problem, pacman -S gnome-perl?
    James
    Last edited by iphitus (2007-05-25 11:32:57)

  • How do you print multiple different images on a single page in preview

    How do you print multiple different images on a single page in preview?

    Chances are no one who saw your question knew the answer.
    Unless you're willing to share the answer you found here, then anyone else like you searching for the problem who comes across this thread will also be unable to thank you for providing the answer too.  

  • How can you check a different iCloud account in safari in an iPad?

    How can you check a different iCloud account in safari in an iPad?

    As currently designed, you cannot. Once iCloud detects you are on mobile Safari, it switches you to the iPad screen.
    If you had another browser that would allow you to pretend you were a desktop Safari client, ie8 or 9, or Firefox, that might work.
    But, Puffin and Opera mini don't work.
    Gary

  • HT204382 How do you read AVI sequences with Quick Time Player ?

    How do you read AVI sequences with Quick Time Player ? H2OT

    Hope somebody will help, I downloaded Flip4MacWMV 2.4.4.2dmg as recommended but it did not work. can I get HELP? Thanks

  • How do you read an iTunes Book on your Mac computer?

    When my iPod was down, I wanted to reply to a friend about something I had read on a book that I had purchased on the ITunes Store.  Clicking on the book in iTunes on my iMac would not open the book so that I could read it.  I copied it to my desktop, but when I tried to read it with Text or Pages, it would not give me anything but jibberish.  I asked the above question (title) on the iTunes Store Search bar, but it only gave me an App that was a Chinese book reader.  So, How do you read an iTunes Book on your computer?

    Content from ibooks can only be viewed on an IOS device at this time

  • How do you read the camera position in the 3d picture control?

    Hello,
    There is a method to setup the camera position, but how do you read the current camera position?  e.g. the user uses the mouse, ctrl, and shift, to change the camera position.  How do you read this new camera position?  There don't seem to be any properties to do this.
    I've read this thread:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=214629&requireLogin=False
    but the question was never answered....
    From the comments in that thread, even if you had the proper documentation for the "Model Matrix" property, you couldn't get the information necessary to calculation the camera position.

    Lorielle,
    Thanks for the VI.
    Could you point me towards a more detailed description of the "Modelview Matrix" property?  I've attached a screenshot from the online help.  It is not very helpful.
    Attachments:
    Modelview Matrix.jpg ‏71 KB
    Modelview Matrix1.jpg ‏71 KB

  • HT4587 How do you read the Serial Number on the back of the Airport Express? It is sop small and silver writing on hite background?

    How do you read the Serial Number on the back of the Airport Express? It is sop small and silver writing on white background?

    http://support.apple.com/kb/ht3546

  • How can you tell the differance between an iphone charger and an ipad charger?

    how can you tell the differance between an iphone and ipad charger

    http://store.apple.com/us/product/MC359LL/A/apple-ipad-10w-usb-power-adapter?fno de=3c
    http://store.apple.com/us/product/MD810LL/A/apple-5w-usb-power-adapter?fnode=48

  • How do you add a custom label to dates in contacts.....

    How do you add a custom label to dates in contacts- I have multiple birthdays in contact group and want to change label through customise to add additional birthday- unless another way to add second birthday to contacts and identify each one?????? or way to link contacts with same address phone number etc but id birthdays?????

    You have some contacts with more than one birthday?
    To add a custom label for a date, select Edit for an existing contact. Select Add Field. Select Date. Scroll up with the Info window above the date selection and select Other for the new date selection. Select Add Custom Label and then select this label for the new date field for the contact.
    As far as linking dates with multiple contacts, the answer is no to that.

  • How do you create a column of sequenced dates in Numbers

    How do you create a column of sequenced dates in Numbers without typing in each date? For example: 01/05/15, 01/12/15, 01/19/15, 01/26/15, 02/02/15, etc.

    Hi Cha Ling,
    Another way,
    Enter your first two dates that show the desired interval- i.e. 01/05/15 and 01/12/15.
    Select both cells and choose fill from the contextual menu.
    Drag down to fill your column.
    quinn

  • How do you merge two different users on one computer?

    I created a user account on my computer, then when I used Migration Assistant to transfer some of the files off my old computer onto my new MacBook Air it transferred them into a new user account.  How do I merge the two different users? They are both me.

    You can't "merge" users, you have to transfer the files using intermediate steps to deal with Permissions issues.
    You found out first hand that you should use Setup Assistant, rather than Migration Assistant to perform the action that is now causing trouble, and time.
    1) Log in to the A account.
    2) Locate all the files you want to move. Move them to /Users/A/Public. Note: Don't move any System-created top-level folders, like Documents, Pictures, Music, Movies, etc. Just move their contents.
    3) Log in to the B account.
    4) Navigate with Finder to /Users/A/Public. Drag the files to the Desktop. This will make new copies of them that will have the correct permissions for User B.
    5) Put the new copies of the files away in the appropriate places in B's home folder.
    6) Delete the A user account if it is no longer needed.
    Doing it this way will ensure that there are no permissions headaches with the files after they are moved.
    Also, make sure that you BACK UP all of your data before starting.
    Credit: to user Kiraly for the process.

  • How can you have multiple, different css link styles?

    Every time I want to create a different looking link just for some copy, it always reverts to the A:link style, even if I create a new style that looks just the way I want. How can I create multiple link styles and then be able to select the one I want at any time???
    I would greatly appreciate any help.
    Allan

    How are you applying the different styles to your links? In most cases, it's easiest to wrap the link(s) in an element, like a < div > that has a class or ID assigned, for instance class="altLinks". Then, set up the CSS style names like:
    .altLinks a:link
    ...and so on. Then, the styles would just apply to links within the element(s) with class "altLinks". Here's a tutorial that might also help:
    http://www.golivecentral.com/pages/tutorials.shtml#basicCSSlinks2
    Otherwise, if you're still having trouble, post back with a link to your page so we can see what's going on.

Maybe you are looking for

  • My photos will not sync from my phone to computer

    I have a new macbook pro with retina display and whenever I try to sync my photos from my phone to iPhoto, it either doesn't sync at all or it will stop half way through and just be frozen at importing one photo. If I try to stop and save the photos

  • SecurityException with Helper.getMBeanHome()

    Hello, I used the Helper class to get the MBeanServer. But when I run the following piece of code public final void donttestMultipleGetMBeanServer() {     MBeanHome home = Helper.getMBeanHome("weblogic", "weblogic", "t3://localhost:7001", "DevDom");

  • Error Message in Premiere Elements 7

    I have used Premiere Elements 7 successfully for some time. I recently got a new Windows 7 laptop and loaded PREL 7 onto it. When I start a new project, in the ORGANISE section, when I go to add media, I select as I did before an .mp4 file but after

  • How to use parameter passed from standard page in VO query of custom page

    Hi everyone, I have a custom page which needs to be called from a standard page. Now this custom page is based on some parameters passed from standard page. How do I catch those parameters i my custom page . And how to use those parameters in the VO

  • Why can't i use "INNER JOIN" in a query for SQL Server with JDBC??????

    Hi, I'm trying to execute some SQL queries and I just don't understand what's wrong. I�m using Tomcat and SQL Server in order to do this, but when I�m try to execute a query with a INNER JOIN statements Tomcat raise a SQL exception... at the very fir