I would assume, and I know the dangers of ass-um-ing, that there is a high likelihood of there being commas in the data. <br><br><div class="gmail_quote">On Mon, Aug 13, 2012 at 1:19 PM, Brian K. White <span dir="ltr"><<a href="mailto:brian@aljex.com" target="_blank">brian@aljex.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you intend to import into plain old excel, then why aren't you just<br>
using export word?<br>
<br>
export word out = "filename.csv"<br>
<br>
that all by itself produces<br>
<br>
"aaa","bbb","ccc"<br>
<br>
If you have quotes in the data, you can make a gosub that you run on the<br>
dangerous fields to detect and edit the field on the fly, the edit is<br>
simply to double any quotes. unfortunately the simplest code for that<br>
requires reading the old variable one character at a time, and building<br>
a new one. </blockquote><div><br><br>Or you could use filePro's xlate command on the field to double them up.<br><br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But, you can put it all in a gosub and only call that gosub<br>
on the few fields that are in danger of having quotes in them, and then<br>
on top of that, that gosub can start with a single line to detect if<br>
there are any quotes at all and skip all the work in most cases. So most<br>
of the time the routine will not even be called so it shouldn't slow<br>
down most exports.<br>
<br>
<br>
then: n=6 ; gosub esq ; out(6)=n<br>
...<br>
then: n=20 ; gosub esq ; out(20)=n<br>
...<br>
then: end<br>
<br>
esq: ' escape quotes in N<br>
if: not n co chr("92") ' do nothing unless needed<br>
then: return<br>
if:<br>
then: p(8,.0) = "1" ; ic(1) = "" ; o = ""<br>
then: l(8,.0) = len(n{"")<br>
esql: if:<br>
then: ic = mid(n,p,"1") ; oc = ic<br>
if: asc(ic) eq "92"<br>
then: oc = ic{ic<br>
if:<br>
then: o = o & oc<br>
if: p lt l<br>
then: p = p + "1" ; goto esql<br>
if: ' return the edited N<br>
then: n = o ; return<br>
<br>
<br>
n is the input and then also overwritten for the output at the end<br>
<br>
p is a postion marker within the input n, it walks through from<br>
character 1 to the end of n<br>
<br>
ic is a single input character, it has one character from n at a time<br>
<br>
oc is a single output character or multi-character replacement<br>
<br>
o is the temp new output as it's being built up during the routine<br>
<br>
<br>
Everything else besides double-quotes, not only commas but even<br>
linefeeds and carriage returns should be fine inside the fields.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
bkw<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On 8/13/2012 11:28 AM, Scott Walker wrote:<br>
> Brian,<br>
><br>
> Thanks. You know what. I just tested excel and it does not let you specify<br>
> (2) characters as a field separator so I guess I'm stuck using one.<br>
><br>
> Regards,<br>
><br>
> Scott<br>
><br>
><br>
>> -----Original Message-----<br>
>> From: filepro-list-<br>
>> bounces+scottwalker=<a href="mailto:ramsystemscorp.com@lists.celestial.com">ramsystemscorp.com@lists.celestial.com</a><br>
>> [mailto:<a href="mailto:filepro-list-">filepro-list-</a><br>
>> bounces+scottwalker=<a href="mailto:ramsystemscorp.com@lists.celestial.com">ramsystemscorp.com@lists.celestial.com</a>] On Behalf Of<br>
>> Brian K. White<br>
>> Sent: Monday, August 13, 2012 11:20 AM<br>
>> To: <a href="mailto:filepro-list@lists.celestial.com">filepro-list@lists.celestial.com</a><br>
>> Subject: Re: Export Field Seperator<br>
>><br>
>> This should work:<br>
>><br>
>> export ascii alias = name r=\n o=| c=|<br>
>><br>
>> But I haven't tried it.<br>
>><br>
>> --<br>
>> bkw<br>
>><br>
>><br>
>> On 8/12/2012 6:35 PM, Scott Walker wrote:<br>
>>> I'm doing an export ascii.<br>
>>><br>
>>> Is there an easy way to use two characters as the field separator.<br>
>>><br>
>>> Specifically I'm trying to use two pipe symbols as the field separator.<br>
>>><br>
>>> Regards,<br>
>>><br>
>>> Scott<br>
>>><br>
>>><br>
>>> Scott Walker<br>
>>> RAM Systems Corp<br>
>>> <a href="tel:%28704%29%20896-6549" value="+17048966549">(704) 896-6549</a><br>
>>> Scott.Walker@RAMSystemsCorp.com<br>
>>><br>
>>> <a href="http://www.RAMSystemsCorp.com" target="_blank">www.RAMSystemsCorp.com</a><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Filepro-list mailing list<br>
>>> <a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>
>>> Subscribe/Unsubscribe/Subscription Changes<br>
>>> <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
>>><br>
>><br>
>> _______________________________________________<br>
>> Filepro-list mailing list<br>
>> <a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>
>> Subscribe/Unsubscribe/Subscription Changes<br>
>> <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
><br>
><br>
><br>
<br>
_______________________________________________<br>
Filepro-list mailing list<br>
<a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>
Subscribe/Unsubscribe/Subscription Changes<br>
<a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
</div></div></blockquote></div><br>