Unix import of a DOS spreadsheet...

Brian K. White brian at aljex.com
Tue Sep 7 11:39:07 PDT 2010


On 9/5/2010 12:04 PM, John Esak wrote:
> Oh well, at least Stuart did have working syntax in the book.  I was wrong.

No he did not have working syntax.
Mike said Stuart had r=10&13
That's 2 bytes which is not valid.

That specific claim of the possibility of 2-bytes, by any possible 
syntax or representation, was Mike's sole and entire question. Not the 
various ways to express a single byte, but the possibility of more than 
one byte by _any_ means. He knows all the ways to express one byte and 
all the ways to manually strip or otherwise disregard the extra CR like 
assign it to a 1 byte field and ignore it, or run it through dos2unix or 
sed, or xlate the last field etc... it would just be efficient and smart 
to make use of a built-in feature to do it for him if it existed.

Personally I think the smartest way is to keep it all in filepro where 
the programmer can see the entire relevent logic in one place instead of 
writing fp code that depends on some external scripts to have used some 
external binary first. It's more portable, maintainable and  transparent 
that way. I like the xlate() on the last field idea. It doesn't cost 
much cpu, and you could even optimize it by performing a test on the 
first record and only xlate() if the 2nd-last byte of the last field of 
the first record was a chr("13"). But even if you just blindly xlate the 
last field all the time, it would automatically handle 99% of situations 
correctly without ever having to rely on any unseen/non-obvious external 
pre/post-processing. Some other programmer can see your code and 
everything that matters is there in the processing, none of it is out in 
some script you forgot to document in comments or forgot to include in 
your backups or restores or site migration etc...

-- 
bkw


More information about the Filepro-list mailing list