-1
// Specify the full path to your file in here.
String datafile = "/home/rez/Desktop/data_example.txt";

double[][] mydata = FileReadingTools.getDoubleArray(datafile);

FileReadingTools gives an error I want a tool to read a text file on my desktop as you can see

DanielGibbs
  • 9,910
  • 11
  • 76
  • 121
A Banitaba
  • 19
  • 8

1 Answers1

0

just use:

public void read() {
    String fileName = "your/path/yourFile.txt";

    try {
        List<String> lines = Files.readAllLines(Paths.get(fileName),
                Charset.defaultCharset());
        for (String line : lines) {
            System.out.println(line);
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
}
huidube
  • 390
  • 3
  • 15