Import question

Kenneth Brody kenbrody at bestweb.net
Mon Mar 20 13:06:16 PST 2006


Quoting Don Coleman (Mon, 20 Mar 2006 15:36:08 -0500):
[...]
> 06914995:02:47:42 PM: :SMC:	(copied/pasted from the imported text file)
>
> This is a colon field-delimited file.  My filePro import process stops
> reading data after the apparent blank space after the "PM:".  My hex
> editor says this field contains a hex 00 NUL and each variable after
> this field shows as a blank value.  The import process then continues
> as expected beginning with the next record (NL).  This problem arose
> after a software update to the alien application creating the file.
> They have been unable to explain or correct the issue on their end so
> it looks like I have to program around it.  This happens in a limited
> number of random records (1-10/day) out of up to 25,000 records in the
> file.  Any suggestions on how to program around this so the file does
> not have to be manually edited.  In order to fix presently you must
> open the file with a text editor and delete that "invisible" character.
> It then imports correctly.

Obviously, the correct way to fix this is to have the program that
creates the file no longer put a NUL ('\0') character into it.

Until then, you could write a quick script to fix it.  My copy of
"tr" will work with:

    tr "\0" "~" <file1.txt >file2.txt

This will convert the NUL to a '~'.  (Change the tilde to something
else if you wish, like a space.)

Or, this simply deletes the NUL:

    tr -d "\0" <file1.txt >file2.txt

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list