Results 1 to 2 of 2
  1. #1
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default .txt file to multidimensional array

    I have a .txt file that contains either i's or j's. There are 7000 characters in total which are all either i or j. I need to place these into an array where each row is 70 characters long and there are a 100 rows in total. I have a custom package based on the buffered reader which can read in the values. I am pretty sure I need to use a loop to loop through all the character values but I am lost as to what loop to use and how to use it in the correct way. Any help would be greatly appreciated :) .
    Last edited by Hazza; 11-11-2012 at 09:21 PM.

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default Re: .txt file to multidimensional array

    There are essentially two types of loop - counting loops when the set size is known, and conditional loops where looping is infinite until a condition is met. A for-loop is a great example of a counting loop, as it loops i times, where i is a number you predefine. A while-loop is the other kind and terminates based on a boolean condition.

    Which type of loop do you think you need and why?

Similar Threads

  1. Multidimensional Array
    By TyCox94 in forum New To Java
    Replies: 11
    Last Post: 09-25-2011, 11:00 PM
  2. Multidimensional char array
    By leepikamukharji in forum New To Java
    Replies: 18
    Last Post: 04-13-2011, 01:18 PM
  3. Multidimensional Array help
    By Gaebril in forum New To Java
    Replies: 1
    Last Post: 04-09-2011, 08:36 PM
  4. Multidimensional array - swap
    By BeginnerNoob in forum New To Java
    Replies: 13
    Last Post: 03-30-2011, 03:02 PM
  5. [SOLVED] Multidimensional array
    By Torgero in forum New To Java
    Replies: 20
    Last Post: 03-22-2009, 11:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •