Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Read text from a file and hold in an array

    Hi Im trying to read lines from an external file and hold them in an array for future use using java.
    I can read the file and print its contents but im not sure on the next step to hold the info in the array.

    The information in the file looks similar to this
    00001 1 3 2
    00002 3 2 1

    With first number is the number of a ballot paper and the next three numbers are ranks of three candidates by preference.

    Any help much appreciated

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,934
    Thanks
    79
    Thanked 4,424 Times in 4,389 Posts
    Quote Originally Posted by wales123 View Post
    Hi Im trying to read lines from an external file and hold them in an array for future use using java.
    This is the JavaSCRIPT forum.

    About the only similarity between Java and JavaSCRIPT are the first four letters of their names.

    If you are really asking a JAVA question, you are in the wrong forum.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oops posted in the worng section.
    Any chance it could be moved or ill start up another thread . . ?

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,934
    Thanks
    79
    Thanked 4,424 Times in 4,389 Posts
    a mod will eventually move it, but it can take a while.

    Just close this thread (mark it as RESOLVED using the "thread tools") and start a new one in Java forum.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Quote Originally Posted by Old Pedant View Post
    a mod will eventually move it, but it can take a while.

    Just close this thread (mark it as RESOLVED using the "thread tools") and start a new one in Java forum.
    Why not PM a mod, or simply use the Report This Post link. I have done that for you.

  • #6
    Banned
    Join Date
    Feb 2011
    Posts
    2,699
    Thanks
    13
    Thanked 395 Times in 395 Posts
    Whether you are using javascript or java, you can do what you want with AJAX if running the application from a browser
    Last edited by bullant; 04-28-2011 at 07:50 AM.


  •  

    Posting Permissions

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