To simplify the discussion, let N = 3.
N = 3
My current approach to extracting the last three characters of every line in a file or stream is to use sed
sed
rev /path/file | cut -c -3 | rev