1String wordToFind="Hello";
2List<String> lines=Files.readAllLines(Path.of("yourFile.txt"));
3for(int i=0;i<lines.size();i++){
4 int col;
5 while((col=lines.indexOf(wordToFind))!=-1){
6 System.out.println("found "+wordToFind+" in line "+i+" at column "+col);
7 }
8}