On Tue, Sep 18, 2007 at 08:51:02AM -0400, Eric Dimick Eastman wrote:
> If you are running on a unix-like platform, you could preprocess the file
> with the "tr" utility translating nulls into spaces or "\001". I don't know
If "tr" is available in your environment I'd definitely recommend using
it, but if you aren't on Unix (or if your particular version of "tr"
can't handle files with NULL characters), you should also be able to use
a simple SQR program to read the file byte-by-byte to do the same sort
of translation.
Here's an example program that takes this approach:
http://www.sqrug.org/ftp/translate_nulls.sqr
I have only tested it under Unix, but believe it should work just as
well on most platforms where SQR is available.
The idea is that you'd pre-process your file using this utility, and
then could run your existing SQR program without needed to do anything
fancy string-handling inside that program. Depending on the format of
your input file, you can decided whether it's better to replace the NULL
characters with some other character or just to strip them out (using
the "-debugs" option).
Nathan
----------------------------------------------------------------------------
Nathan Stratton Treadway - nathanst@ontko.com - Mid-Atlantic region
Ray Ontko & Co. - Software consulting services - http://www.ontko.com/
GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt ID: 1023D/ECFB6239
Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239
Attachment:
signature.asc
Description: Digital signature
_______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users