Alaska Software Inc. - csv file
Username: Password:
AuthorTopic: csv file
sudeep sharmacsv file
on Fri, 29 Dec 2017 23:46:17 +0530
can anybody tell me how to create csv file in xbase application.

Sudeep Sharma
Adam MesterRe: csv file
on Tue, 02 Jan 2018 21:30:59 +0100
sudeep sharma wrote in message
news:11defb3d$2a88b5e9$11bc7f@news.alaska-software.com...
>can anybody tell me how to create csv file in xbase application.
>
>Sudeep Sharma

Hi!

If you want to create a CSV from a DBF file, use the function DbExport() and
set <cDbeName> parameter to "DELDBE". You can set the field delimiters and
others with the parameter <aDbeInfo>.
 
See further details about DELDBE in the documentation: "Database Engines ->
ASCII file (SDF/TXT) -> DELDBE"
Hubert BrandelRe: csv file
on Thu, 04 Jan 2018 15:11:47 +0100
Am 29.12.2017 um 19:16 schrieb sudeep sharma:
> can anybody tell me how to create csv file in xbase application.
> 
> Sudeep Sharma

a very easy way is the same as with clipper:

set console off
set alternate to "myFile.csv"
set alternate on

? "Field1;Field2;Field3"
do while ! eof()
    if PrintRecord()  your filter
       ? ... all your fieldnames ...
    endif
    skip
enddo

 Depending what you need !!!

Excel in Germany needs 1,90 not 1.90
Excel use ";" instead of "," between fields
Strings should be in " ... "
Maybe you don't want to have
CRLF inside a variable ?
how to print date fields ...

so I would make a function to handle
the data fields as you need, like

function PrintValCSV(cVar)
default cVar to ""
do case
    case valtype(cVar)="C"
         cVar := '"'+cVar+'"'  alltrim() ?
    case valtype(cVar)="N"  with or without dec ?
         cVar := str(cVar)  Translate() ?
         cVar := StrTran(cVar,",",cDelim)  "." => ","
    case valtype(cVar)="D"
         cVar := dtos(cVar)  or iso or ???
endcase
return cVar
Hubert BrandelRe: csv file
on Thu, 04 Jan 2018 15:12:47 +0100
I forgot the

set alternate to

at the end