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

John W. Scott john at dharmarose.com
Thu Jul 31 10:21:50 PDT 2008


Thanks Dave for making certain I had seen your reply (which I had  
indeed missed).

Although I have been using ProVue apps for over 20 years (damn that  
makes me old), I have no experience with ArrayBuild.  I suppose it  
would behoove me to at least learn what it does (my to-do list is a  
queue rather than a stack).

In any case, the fileload route worked beautifully on a smaller data  
subset, but when I tied it with my full data which includes a 2.9 Meg  
csv file I get an "Expression stack overflow."

Is that too large a file for this sort of solution?

On Jul 29, 2008, at 12:21, David Thompson wrote:

>> While I have a better grasp of what is not causing the mysterious
>> null strings, but feel no closer to solving them.
>>
>> Any more ideas?
>
> Only a guess that it might have something to do with the fact that
> you are exporting more than one record per line. It may be a bug in
> SaveAsText.
>
> An alternative method for creating this file would be to create the
> text with an ArrayBuild, tack on the header, and do a FileSave. You
> would use a non-printing character as your separator in the
> ArrayBuild so that they could be removed with a replace( function, or
> even a stripprintable( if it came to that. It might look something
> like this.
>
> Local theText,folder,file
> file="YourFileName.csv"
> ArrayBuild theText,chr(1),"",formula
> theText="Your header"+chr(13)+replace(theText,chr(1),"")
> SaveFileDialog folder,file,"Save this file as:"
> If file = "" stop endif
> FileSave folder,file,"",theText
>
> Where it says formula, you would use the formula you currently have
> in the data tile, without the enclosing {} braces.
>
> If you still want to use SaveAsText and a form, you could follow the
> SaveAsText with code to load the file into a variable, clean out the
> non-printing characters, and save it back with a FileSave.
>
> Local theText
> theText = stripprintable(fileload(folder(thePath),file))
> FileSave folder(thePath),file,"",theText
>
> thePath would be the folder path of the file you saved with the
> SaveAsText, and file would be the name of that file.
>
> Dave
> _______________________________________________
> Qna mailing list
> Qna at provue.com
> http://provue.com/mailman/listinfo/qna
>



More information about the Qna mailing list