Здравствуйте.
Скрин прикрепил.
![]()

package com.javarush.task.pro.task15.task1506;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.Objects;
import java.util.Scanner;
/*
Фейсконтроль
*/
public class Solution {
public static void main(String[] args) throws IOException {
//напишите тут ваш код
Scanner s = new Scanner(System.in);
String pathFile = s.nextLine();
List<String> strings = Files.readAllLines(Paths.get(pathFile), StandardCharsets.UTF_8);
strings.forEach(
line -> {
for (char c : line.toCharArray()) {
if (c != ' ' && c != '.' && c != ',') {
System.out.print(c);
}
}
}
);
}
}