Skip to content

Instantly share code, notes, and snippets.

@GaetanoPiazzolla
Created September 18, 2021 10:47
Show Gist options
  • Save GaetanoPiazzolla/56b32f7931affdef6370819aad1ab1ec to your computer and use it in GitHub Desktop.
Save GaetanoPiazzolla/56b32f7931affdef6370819aad1ab1ec to your computer and use it in GitHub Desktop.
import java.nio.file.Files;
import java.nio.file.Path;
private final static String SEARCH_TOKEN = "searchtoken";
public List<String> searchStandard(String pathFile) {
List<String> wholeData = Files.readAllLines(Path.of(pathFile));
List<String> found = new ArrayList<>();
for (String wholeDatum : wholeData) {
if (wholeDatum.contains(SEARCH_TOKEN))
found.add(wholeDatum);
}
return found;
}
@GaetanoPiazzolla
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment