Subject Re: character string problem
From Charlie <tm@tc.com>
Date Sat, 16 Mar 2019 14:13:13 -0400
Newsgroups dbase.getting-started

Hi Mervyn... Sorry about your electricity.  That usually happens here when we have a hurricane.

One question.  Say I want to do the same with the title field.  Would I just do it concurrently or would I need to do it in a different loop?

Thanks again for your help!!

Mervyn Bick Wrote:

> On 2019-03-16 12:47 AM, Charlie wrote:
> > OK so as it turns out my problem is bigger than I thought.  Every time I had an 18 inch passenger car or whatever I used double quotes.  So now I have a number of double quotes in the fields title and au_desc.  Is there a way to replace all " with in or would I be better off using a different enclosure for columns?  I know you can use different delimiters, but not sure if you can change the " to ^ or | for instance??
>
> Sorry this has taken so long to reply to but we were without power from
> 08:03 to 15:50.
>
> The routine to move your .csv file, delimited with ", works so let's not
> change anything there.  To deal with double quotes in the au_desc field
> text you can either "escape" each double qoute with \ or with ".  In the
> code below I've used the \ option
>
>
>
> .......
>                 replace asell with master->asell
>                 replace au_desc with master->au_desc
>                 sele a
>         //endif
>         skip
> enddo
> sele b
> ******** Add the following to your existing program *****
> go top
> do while not eof()
>    audesc = au_desc
>    for n = len(audesc) to 1 step -1
>        if substr(audesc,n,1) = ["]
>           audesc = stuff(audesc,n,1,[\"])
>        endif
>     next
>    replace au_desc with audesc
>    skip
> enddo
> go top
>
> ********
> copy fields id,part_no,title,qty,sell,grade,mfg,cuml,sdate,asell,au_desc
> to master.csv delimited
> //c:\golfcb\info\users.csv delimited
> cnt=0
> count to cnt
> ******* Start of program *****
> cFileIn ='master.csv'
> cFileOut = 'tempworkfile.txt'
> .........
>
> Mervyn.
>