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">&lt;<a href="mailto:brian@aljex.com" target="_blank">brian@aljex.com</a>&gt;</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&#39;t you just<br>
using export word?<br>
<br>
export word out = &quot;filename.csv&quot;<br>
<br>
that all by itself produces<br>
<br>
&quot;aaa&quot;,&quot;bbb&quot;,&quot;ccc&quot;<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&#39;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&#39;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: &#39; escape quotes in N<br>
if: not n co chr(&quot;92&quot;) &#39; do nothing unless needed<br>
then: return<br>
if:<br>
then: p(8,.0) = &quot;1&quot; ; ic(1) = &quot;&quot; ; o = &quot;&quot;<br>
then: l(8,.0) = len(n{&quot;&quot;)<br>
esql: if:<br>
then: ic = mid(n,p,&quot;1&quot;) ; oc = ic<br>
if: asc(ic) eq &quot;92&quot;<br>
then: oc = ic{ic<br>
if:<br>
then: o = o &amp; oc<br>
if: p lt l<br>
then: p = p + &quot;1&quot; ; goto esql<br>
if: &#39; 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&#39;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>
&gt; Brian,<br>
&gt;<br>
&gt; Thanks.  You know what.  I just tested excel and it does not let you specify<br>
&gt; (2) characters as a field separator so I guess I&#39;m stuck using one.<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; Scott<br>
&gt;<br>
&gt;<br>
&gt;&gt; -----Original Message-----<br>
&gt;&gt; From: filepro-list-<br>
&gt;&gt; bounces+scottwalker=<a href="mailto:ramsystemscorp.com@lists.celestial.com">ramsystemscorp.com@lists.celestial.com</a><br>
&gt;&gt; [mailto:<a href="mailto:filepro-list-">filepro-list-</a><br>
&gt;&gt; bounces+scottwalker=<a href="mailto:ramsystemscorp.com@lists.celestial.com">ramsystemscorp.com@lists.celestial.com</a>] On Behalf Of<br>
&gt;&gt; Brian K. White<br>
&gt;&gt; Sent: Monday, August 13, 2012 11:20 AM<br>
&gt;&gt; To: <a href="mailto:filepro-list@lists.celestial.com">filepro-list@lists.celestial.com</a><br>
&gt;&gt; Subject: Re: Export Field Seperator<br>
&gt;&gt;<br>
&gt;&gt; This should work:<br>
&gt;&gt;<br>
&gt;&gt; export ascii alias = name r=\n o=| c=|<br>
&gt;&gt;<br>
&gt;&gt; But I haven&#39;t tried it.<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; bkw<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 8/12/2012 6:35 PM, Scott Walker wrote:<br>
&gt;&gt;&gt; I&#39;m doing an export ascii.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Is there an easy way to use two characters as the field separator.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Specifically I&#39;m trying to use two pipe symbols as the field separator.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Regards,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Scott<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Scott Walker<br>
&gt;&gt;&gt; RAM Systems Corp<br>
&gt;&gt;&gt; <a href="tel:%28704%29%20896-6549" value="+17048966549">(704) 896-6549</a><br>
&gt;&gt;&gt; Scott.Walker@RAMSystemsCorp.com<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; <a href="http://www.RAMSystemsCorp.com" target="_blank">www.RAMSystemsCorp.com</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; Filepro-list mailing list<br>
&gt;&gt;&gt; <a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>
&gt;&gt;&gt; Subscribe/Unsubscribe/Subscription Changes<br>
&gt;&gt;&gt; <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Filepro-list mailing list<br>
&gt;&gt; <a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>
&gt;&gt; Subscribe/Unsubscribe/Subscription Changes<br>
&gt;&gt; <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
&gt;<br>
&gt;<br>
&gt;<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>