Skip to content

Instantly share code, notes, and snippets.

@Ikhiloya
Created July 24, 2018 11:52
Show Gist options
  • Select an option

  • Save Ikhiloya/30674680825e1f4549350d61474a5767 to your computer and use it in GitHub Desktop.

Select an option

Save Ikhiloya/30674680825e1f4549350d61474a5767 to your computer and use it in GitHub Desktop.
A code snippe t
public static List<String> getFile(String filePath) throws IOException {
BufferedReader br =
new BufferedReader(new FileReader
(filePath));
List<String> lines = new ArrayList<String>();
// Read file line by line
String line = "";
while ((line = br.readLine()) != null) {
// Parse line to extract individual fields
lines.add(line);
}
System.out.println("Done Reading from file");
br.close();
return lines;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment