Complex CSV export part 2 - the attack of the spurrious invisible characters

David Thompson dthmpsn1 at illinois.edu
Mon Jul 21 06:49:16 PDT 2008


>Slowly and steadily I am getting there, but have run into another 
>strange phenomenon.
>As part of my twisted report, I am getting some strange invisible 
>characters at the (seemingly random) beginnings of some lines. 
>There are typically 1-3 of these characters  when they occur, always 
>at the beginning of a line, but not at the beginning of every line. 
>When I do a grep from a copy and paste, Text Wrangler reports that 
>the offending character is "/x00".
>
>My form uses a normal carriage return from my apple keyboard as I 
>have done with countless other forms without this result.
>
>In a worst case scenario I can do a grep every time I need to upload 
>my database, but I would prefer to understand and fix this.

The fact that this is happening inconsistently would seem to indicate 
that these characters are in the data, rather than the form, so you 
probably need to look at where that data came from, and how it was 
entered in the database. You could use the stripchar( function to 
reduce the text to approved ranges. Something like

stripchar(text,chr(9)+chr(9)+chr(13)+chr(13)+chr(32)+chr(126)+chr(128)+chr(255))

If you are assembling the text in a variable, and then doing a 
FileSave, you could apply the stripchar( to its contents right before 
the FileSave. You could also use it in formula fill operations to 
clean up the text in your text fields.

Dave


More information about the Qna mailing list