July 2017
Beginner to intermediate
715 pages
17h 3m
English
Being able to read data is the most important skill for a data scientist, and this data is usually in text format, be it TXT, CSV, or any other format. In Java I/O API, the subclasses of the Reader classes deal with reading text files.
Suppose we have a text.txt file with some sentences (which may or may not make sense):
If you need to read the whole file as a list of strings, the usual Java I/O way of doing this is using BufferedReader:
List<String> lines = new ArrayList<>(); try (InputStream is = new FileInputStream("data/text.txt")) { try (InputStreamReader ...Read now
Unlock full access