Last active
September 4, 2016 00:22
-
-
Save djuniorscjr/d34fe175faeb1a183f8c99acd97ffae7 to your computer and use it in GitHub Desktop.
Example read file using java 8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final String relativePath = PATH_ARQUIVO.CSV; | |
final ClassLoader classLoader = getClass().getClassLoader(); | |
final InputStream resourceAsStream = classLoader.getResourceAsStream(relativePath); | |
try (BufferedReader buffer = new BufferedReader(new InputStreamReader(resourceAsStream))) { | |
buffer.lines().collect(Collectors.toList()).forEach(line -> { | |
final String[] arrayBank = line.split(";"); | |
String value = line[COLUNA_TIPO_MOEDA]; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment