So, i'm using bash to read a file (that has no newlines, space or tab).
Something like this:
though there is a newline in this example, there isn't on the data i'm working on... So i found that, since everything was technically seen as on "the same line" (since there isn't any newline or any delimiter i could use), i tried to read every Nth chars:
while read -N129999 character; do program "$character" done < <(cat file | tr -d '\n')
(I'm aware of the "useless use of cat")
The number i'm using here is just the maximum i found that i could make
read use, (which also i prefer doing since it process the file faster)
program here is just an example and for the sake of illustration.
And i'm purposely removing newline, tabs and space on the aforementioned data.
Now while what i provided work, it doesn't quite work for the last part of the file, which contain less than the aforementioned number...and while i'm aware that, if there was a delimiter provided to
IFS, the -n option could continue after that instead of ignoring the rest of file which doesn't fit the range of characters...
How do i (in bash, sed, or any posix tools?) read every Nth range of characters, while including the rest of the file/input, which doesn't fit that range?