Hi Gaylen,
Glad the copy delimted works for you. However copy delimited may not do every sort of CSV that customers want. If you should have the misfortune to encounter the weird ones you can also use low level file functions to get the precise requirements.
For example:
lparameters lcFile,lcOutputFile
afields(laFields,m.lcFile)
erase (m.lcOutputFile)
m.lnHandle=fcreate(m.lcOutputFile)
m.lcSeparator = ";"
local m.i
select (lcFile)
scan
lcLine = ""
for i = 1 to alen(laFields,1)
m.lxValue =evaluate(laFields(i,1))
if !empty(m.lxValue)
m.lcValue = ALLTRIM(transform(m.lxValue))
m.lcValue = strt(strt(STRTRAN(m.lcValue,"'",""),["],""),[,],"")
m.lcValue = ["]+alltrim(m.lcValue) +["]
else
m.lcValue = ""
endif
m.lcLine = m.lcLine+m.lcValue+m.lcSeparator
endfor
m.lcLine = substr(m.lcLine,1,rat(m.lcSeparator,m.lcLine)-1)
fputs(m.lnHandle,m.lcLine)
endscan
fclose(m.lnHandle)
select (m.lnSelect)
Mind you, copy to... -> filetostr -> manipulate -> strtofile is another way to skin the cat.
>Thanks Edward
>
>That works just fine. It eliminates the header and encloses the text fields with " ".
>
>To the others also that quickly responded I say
>
>Thanks!!
>Gaylen
>
>>>I need to create a comma delimited file from a table with " " around the alpha fields. Copy to xxx type csv works fine except it creates a header record of the fields. The bank wants the csv file without the header.
>>>
>>>Any quick fixes for this.
>>>
>>>Gaylen
>>
>>Try COPY TO ... DELIMITED
James Beerbower
James Beerbower Enterprises
Frankfurt, Deutschland