Works with `sample_text.txt` but not `test.txt`. I suspect that it is caused by special characters in the `test.txt` file.