How do i use array to store a readfile information?

currently i m facing with this problem, i have a set of .txt file data which look like below:
6 6 3 10 3 5
6 8 4 10 8 6
10 17 1 11 1 1
7 18 3 10 3 5
8 19 1 11 1 1
10 20 2 11 1 5
7 20 4 10 8 6
8 22 2 11 1 5
10 25 4 10 8 6
10 26 7 11 1 8
8 27 8 12 1 11
8 28 7 11 1 8
10 30 9 9 8 11
8 31 11 12 3 12
10 32 10 11 1 12
now i'm using while ((text = in.readLine()) != null) to read this set of data.
how do i can store this set of data into array form as below??
int [ ][ ] data = new String [100][6];
//6 6 3 10 3 5 1st row
data[0][0] = ( "6" );
data[0][1] = ( "6" );
data[0][2] = ( "3" );
data[0][3] = ( "10" );
data[0][4] = ( "3" );
data[0][5] = ( "5" );
//6 8 4 10 8 6 2nd row
data[1][0]= ("6");
data[1][1]= ("8");
data[1][2] = ( "4" );
data[1][3]= ("10");
data[1][4]= ("8");
data[1][5] = ( "6" );

Well using the String.split() method you may be able to turn each line into an array of String numbers. So if you want an array of integers, you'll need to convert each index with Integer.parseInt().

Similar Messages

  • Using array to store objects

    i seen array storing many integers, strings, char. but how to use array to store objects of a class..
    how to define those objects created from a defined class in a array. how to obtain each instance variable of the object stored in the array.
    maybe can use a student class to illustrate.

    i got yr idea man!!
    so whenever the compiler see
    String s = "Hola Mundo";
    it is simply equal to String s = new String("Hola
    Mundo");
    that why we can directly access value to array[0]=
    "hi";
    array[0]=new Student();
    array[0].setName = "Hola Mundo"
    is also similar in certain way to
    array[0]= new String("Hola Mundo");
    i right again this time?Nope waaaay off.
    If Name is public in Student then it would be:
    array[0].name = "Hola Mundo";
    if name is private and you have a public setter setName(String newName) then it would be:
    array[0].setName("Hola Mundo");
    and if array is an array of strings, then array[0] = "Hola Mundo";
    is correct.
    PS: you still need to read the tutorials. I am out now.

  • I do not have a credit card how can I use the App Store from Belize

    I do not have a credit card how can I use the App Store from Belize

    iTunes gift cards.

  • How do I use the App store with macbook pro and mac pro

    I currently use the app store with the mac book, but want to buy (share?) apps and music with the mac pro.
    I can't find anything that specifically outlines how this works.
    I use SplashID with the macbook and an iPhone, and want to use it (and sync it) on the mac pro as well.
    If you buy apps for a macbook, can you use them on a second machine, or do you need to buy it a second time?

    Your license from the MAS allows you to download and install the apps on as many Macs as you own or have under your control (institutional or employer supplied Macs.) The Mac should to be running Mac OS X 10.6.8 Snow Leopard or Mac OS X 10.7.2 Lion. Open the MAS app on the Mac Pro and sign into your account to have access to download all of your previous purchases in the Purchased pane.
    Simple apps can also be dragged & dropped over a network connection from the MacBook to the Mac Pro.

  • HT202159 How can I use my App store balance to purchase ?

    Hello Apple
    I have 9.99 $ balance in My App Store Balance, How can I use that money? everytime I click to buy an App it will give me the payment option list with out any option of My balance ? so How can I use it ?

    In what country's syore? The US store's prices do not show the local sales taxes added in the final steps of the sale. Are you sure there is enough to cover your app plus the taxes?

  • How to insert delay without using loops, and how can I use variable to store data in labview

    Hi all,
    I am new to Labview and I realized that quite often I am in condition to require a delay beween two functions or elements.. how can we insert a delay in such cases?
    I know how to use delays in a loop. but don't know how to inser some time delay between two elements.
    I have one more question, I know its a bad practice to post 2 questions in 1 thread.
    How can I use a temporary variable to store data, So far I am storing it in an indicator by making it invisible in front panel and making local variable of that indicator, is it the right way to do it ?
    Thanks in advance.

    Generally, LV doesn't have variables in the same sense that most languages do. You can use indicators to perform the same function as variables, but as Adnan pointed out, you run the risk of having race condition and it creates data copies, which is a problem if you have a lot of data. In most cases, you should use wires to perform the function of variables, which is to store data and make it available to the different functions in your code. Instead of thinking about variables, you need to think about data (something like "I have the data coming out of this function. Where does it need to go?").
    Try to take over the world!

  • How can I use in my store (Russian) other country (UAE) credit card?

    I am using Russian app store. But I have only UAE credit card, Can I use i my store other country credit card?

    Hmmm...  Since I am coming in from the US, not sure how to track down a number in a different country.  I would suggest that you call the number that you would dial to place an order.  Hopefully you will get a human being rather than voicemail ****, and they should be able to tell you the right number.
    (Best way to get a human being who can answer questions -- make the company think that you want to spend money!)

  • My employer is issuing an iPad 4 to me, but has informed me that I "...can expect no privacey" of any personal information that may be put on the iPad. This is not acceptable to me. How can I use iTunes to keep my personal information off the iPad?

    My employer is issuing an iPad 4 to me, but has informed me that "...I can expect no privacy" with regard to any information on it. What has me concerned is that my employer has also requested that I use my Persoanl iTunes account to syc and update the iPad.  I am concerend with my personal privacey, as I have two other iPads that use this account regualary.
    My question is: How can I use iTunes to update etc. the company iPad using iTunes without compromising my personal information?
    What I have done is to set up a different sign in (is that called an Apple ID?) within iTunes (I now have two different names I can use to sign in to iTunes). They both still use the same iTunes and my personal apps and information appear to be available to my second sign in name (the second sign in name is what I intend to use for the company iPad). When I sync the company iPad how do/can I keep my persoanl information from being syc'd automatically to the comapany iPad?

    Hi herbie13!
    It sounds like you will still want to link your iPad and computer, but you want to prevent the iPad from syncing information from your computer to your iPad. I have an article here for you that can help tell you how to set this up:
    iOS: Syncing with iTunes
    http://support.apple.com/kb/ht1386
    You will want to follow the steps here to set up the iPad for syncing, but when it comes time to sync, you'll just want to make sure that the boxes for syncing the multitude of items that you can sync remain unchecked so that none of that information gets synced into the iPad.
    Another note: your second Apple ID will not be able to access the apps, music, movies, tv shows, etc., that you have purchased under your primary Apple ID. Even though it seems that the secondary Apple ID still has access to those items, that is just because you are viewing your second Apple ID through the iTunes Store section on your computer and you have those items saved locally on your computer. You will need to repurchase and download all of the content that you wish to use again on your second Apple ID, if that is what you wish to solely use on this iPad.
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • Use array to store negative number

    Hi,
       I use "Initialize array" to set all the 500 elements to "0". Then I input numbers to  "Replace Array Subset"  and generate a new array. But all the positive numbers are correct, negative numbers just become "0". Why? How can I store the negative number in this array?
       Thank you in advance!

    Hi,
    what data type (numeric representation) are you using for the array elements? If it is integer, make sure it's not unsigned (U8, U16, ...) as this data type doesn't allow negative numbers.
    Hope this helps

  • How do i use Arrays and For Loops in Loading Multiple Images?

    I am struggling to load a sequential array of images to appear like a moving image. So when u click the button the images load one after the other.
    The code below is what i have so far, but it fails to do what i seek in that there's only one image loading which is the last image in the array, so either because the images are stacking up atop each other, or because i simply dont understand the basics...
    And, i am unclear about what you said kglad, that my solution will be more complicated because i need to preload my image sequence and then use a loop to load it?
    import flash.net.URLRequest;
    import flash.display.Loader;
    var count:int = 0;
    var imageArray:Array=["1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg","7.jpg",
    "8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg"];
    for(var i:uint=0;i<imageArray.length;i++){
    var btn:YourButton=new YourButton();
    btn.ivar=i;
    addChild(btn);
    btn.x=0;
    btn.y=0;
    btn.addEventListener(MouseEvent.CLICK,clickF);
    var ldr:Loader=new Loader();
    addChild(ldr);
    ldr.x=20;
    ldr.y=20;
    function clickF(e:MouseEvent){
        ldr.load(new URLRequest("D:/flash cs5.5/image_sequence/twirlSeq/"+imageArray[e.currentTarget.ivar]));
    function loadComplete(e:Event){
         // first process loaded image, then...
        count++;
        if(count < imageArray.length){
            loadCurrentImage();  // load the next image
        } else {
            // sequencial loading complete, carry on to next activity
    function loadCurrentImage(){
         ldr.load(imageArray[count]);
         ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

    create a new fla, add btn and add the code i suggested.  test.
    var count:int;
    var imageArray:Array=["1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg","7. jpg",
    "8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg"];
    var ldr0:Loader=new Loader();
    ldr0.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF);
    var ldr1:Loader=new Loader();
    ldr1.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF);
    btn.addEventListener(MouseEvent.CLICK,clickF);
    function clickF(e:MouseEvent):void{
    // initialize count
    count=0;
    // call loadF
    loadF();
    function loadF():void{
    // add one of the loaders to the top of the displaylist and load the next image
    addChild(this["ldr"+count%2])
    this["ldr"+count%2].load(new URLRequest(imageArray[count]));
    function loadCompleteF(e:Event):void{
    // increment count
    count++;
    // check if the last has loaded
    if(count<imageArray.length){
    // if not clear the content out of the next loader.
    if(this["ldr"+count%2].content){
    this["ldr"+count%2].unloadAndStop();
    // and call loadF so the next loader can load the next image in the array
    loadF();
    } else {
    // if the last has loaded.
    // last load completed

  • How do I use arrays in web services?

    I have a function which returns an array of byte? How do I declare an array in Web services.

    public byte[] getBytes();

  • HT2534 how can i use the app store without using my credit card on i tunes or app store??

    ?

    Aj4duke, that is not right. You can
    Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    You can use it for free apps.
    Aj4duke wrote:
    You cannot download anything from the iTunes Store/App Store without a credit card. Since there may be in-app purchases, you will still need a credit card. The best you can do is listen to the 30-90 second demos of the songs or view apps.

  • My computer cannot run itunes 10 how do I use the itunes store

    I have itunes already but my computer is on the old side. I cannot access the itunes store to get new podcasts because it prompts me to download itunes 10 which I cannot run! What should I do?

    I have 10.4.11 and I already have itunes 8 I just want to access the store. is the only way to install that version of itunes. I have noticed that a lot of other people have posted this problem but with no help (for those of you looking to get best answers)

  • How do I use my serial number to find information about my MacBook Pro's Processor and RAM?

    So I want to find information about my MacBook Pro's processor and RAM using the serial number because the MacBook no longer works. I remember being able to find this information on the apple website before, maybe by using the coverage checker. Did they take this information out of the coverage checker? Is it no longer possible for a costumer to obtain this information?

    Append the last three characters of it to http://www.everymac.com/ultimate-mac-lookup/?search_keywords= and load the page.
    This won't reveal how much RAM it currently has installed.
    (117541)

  • How do I use an XML file to stream information to a Webapp?

    I am trying to use XML generated by an event calander application to set it up with an image slider on the sites webpage. I need it to read in event info and use a picture so that the slider can show "Upcomming Events". It would have a picture, date and link to buying tickets from the ticketmaster page. I am pretty new to web apps and not sure how to set one up to utilize an XML data stream.

    Hi,
    You can't use XML to stream data into webapps, but if you convert the xml to a csv file for example, you could use the import function.
    Kind Regards,
    Alex

Maybe you are looking for

  • Accessing web application from users' PC

    Hi there, My server is up and running, appsets are working nicely and everything works perfectly. But I have an issue when accessing the web application from a user PC on the same domain, and I'm not sure if it's down to me or not. From the users' PC

  • How to call a java application in a jar which is in a war file of a ear ?

    So sorry to cross post, but no response in other topics..... Please help! I have a Ear file which contains a war file. xx.ear/META-INF xx.ear/YY.war and the YY.war has the following structure: YY.war/META-INF YY.war/WEB-INF YY.war/WEB-INF/classes YY.

  • How do i install a brother printer on macbook

    How can i install a Brother Printer on a MacBook I do not know the IP address of the printer i have tried installing the Brother software but nothing seems to work

  • Help, I get a pop up window

    I used to have a Yahoo account and set it up on Mail to read all my mails when I bought my computer.  I had too much spam and had to close the account and set up another account.  Well now, every hour I get a pop up window requesting the password for

  • What are disadvantages by using field catalogmerge in ALV

    can any body tell the disadvantages by using field catalogmegre and  maximun how many fields build the filed catalog.