Complex CSV export part 2 - the attack of the spurrious invisible characters
Peter Harden
ph at hardens.com
Thu Jul 31 10:29:27 PDT 2008
No it's not. To copy one of Dave's earlier posts:
> You can try
>
> If val(info("Version")) >= 5.5
> ExtendedExpressionStack
> EndIf
>
> Or you can you can try using the ExpressionStackSize command to
> make the expression stack a little more than twice the size of
> the .bin file you will be creating. Either way, it should only be
> done if the version is 5.5 or later.
Regards
Peter Harden
On 31 Jul 2008, at 18:21, John W. Scott wrote:
> 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
>>
>
> _______________________________________________
> Qna mailing list
> Qna at provue.com
> http://provue.com/mailman/listinfo/qna
>
===================================
Peter Harden
Harden's Ltd
14 Buckingham Street
London
WC2N 6DF
T: 020 7839 4763
F: 020 7839 7561
W: www.hardens.com
===================================
Registered in England & Wales, No 3930364
Reg. office: 14 Buckingham Street, London WC2N 6DF
===================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://provue.com/pipermail/qna/attachments/20080731/218702b1/attachment.html
More information about the Qna
mailing list