On 3/13/23 16:41:47, Glenn Knickerbocker wrote:
Anyone have an idiom for deblocking and translating a file in ASCII that may have either or both of CR and LF (*), ...
The problem is not well-posed. Consider Foo <CR> <LF> Bar Is that two records, or three with a null record between the <CR> and the <LF>.
... and may be split into records, without unnecessarily buffering the whole file? The possibility of null records that I might want to preserve makes this particularly confusing to think through. (*) in either order--I know LFCR is rare, but I'm positive I've run into it on some goofy old system, probably some BBS 30 years ago
I believe PostScript accepts <LFCR> and perhaps HTML does. I've encountered editors which assume the first apparent line separator characterize the file. Some of my code has had problems with files created by Windows editors that don't terminate the last line.
... | deblock linend 0a | split 0d | ... was good enough for the application at hand, but I was hoping someone might already have worked through getting it right.
FSVO "right". -- gil