Skip to main content

read data from text file

1 reply [Last post]
tengimon
Offline
Joined: 2008-06-23

Hi,
Is there any way that I can actually read and import data from other files such as text file, or maybe even excel file?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
shagus
Offline
Joined: 2007-05-10

Hi, here is the example:

import java.io.*;
import java.lang.*;

var inp: BufferedReader = new BufferedReader(new FileReader("tmp.txt"));
var str: String;
while ((str = inp.readLine()) != null) {
System.out.println(str);

}