Search:

Type: Posts; User: JavaPF

Search: Search took 0.21 seconds.

  1. Replies
    11
    Views
    2,723

    [SOLVED] Re: reading from a file

    OK i've come up with a better method for you to use.

    Try this:



    import java.util.Scanner;
    import java.io.*;

    public class Aznprdgy {
  2. Replies
    11
    Views
    2,723

    [SOLVED] Re: reading from a file

    Hey aznprdgy,

    I'm trying to come up with a better way to do this but I think the reason your code is falling over is because you are using "," as a delimiter and when it gets to the end of the...
  3. Replies
    11
    Views
    2,723

    [SOLVED] Re: reading from a file

    Yes I was specifying the full path. Just realised my file was renamed DATA.DAT.txt. ooops. Your code is compiling fine :)
  4. Replies
    11
    Views
    2,723

    [SOLVED] Re: reading from a file

    Sorry I didn't test my code before I submitted it...

    The reason its printing out the list is because you haven't commented out System.out.println(myString[i]); in the for loop.

    I need to take...
  5. Replies
    11
    Views
    2,723

    [SOLVED] Re: reading from a file

    I would personally input the file and split it like this:



    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.InputStreamReader;

    public class Aznprdgy {
  6. Replies
    11
    Views
    2,723

    [SOLVED] Re: reading from a file

    Hello aznprdgy and welcome to the Java programming forums.

    Can you please post your entire code for me to look at?

    What is a1, w1, w2 etc?

    Is your desired output this:

    I need a better...
Results 1 to 6 of 6