FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour APPE FROM ...DELIMITED date-format question.
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
APPE FROM ...DELIMITED date-format question.
Posted: Fri Sep 07, 2012 10:35 AM
Hi,

I want to add CSV-files like into a DBF like this

    11795129,"2012-07-31",42,9,"","Laadbrug",8,1,0,0.00
    11795130,"2012-07-31",42,10,"","Ret.oude ketting",8,1,0,0.00
    11795131,"2012-07-31",42,11,"","",8,1,0,0.00
    11795132,"2012-07-31",42,12,"","HULSHOUT",8,1,0,0.00
    11795133,"2012-07-26",84,1,"","Vervolg",1,3,0,0.00
    11795134,"2012-07-27",97,1,"","JWJ-153",1,0,0,0.00
    11795135,"2012-07-27",54,1,"","YRT-645",1,0,0,0.00
    11795136,"2012-07-27",95,13,"VERS","DEINZE",13,0,0,0.00
    11795137,"2012-07-27",95,14,"","13.30U - 17.30U",13,0,0,0.00
    11795138,"2012-07-27",95,15,"","31545",13,0,0,0.00
    11795139,"2012-07-27",95,16,"","laden3007",13,0,0,0.00
    11795140,"2012-07-27",95,17,"","LONDERZEEL",13,0,0,0.00
    11795141,"2012-07-27",91,11,"VERS","DEINZE",11,2,0,0.00
    11795142,"2012-07-27",91,12,"","13.30U - 17.30U",11,2,0,0.00
    11795143,"2012-07-27",91,13,"","31544",11,2,0,0.00
    11795144,"2012-07-27",91,14,"","laden3007",11,2,0,0.00
    [/list:u]

    All fields are imported except the date.
    I have tried to use
    Code (fw): Select all Collapse
    SET DATE ansi

    Without result.
    Does anyone know how to import this?

    Thanks,
    Marc
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 117
Joined: Tue Jan 03, 2006 06:18 PM
Re: APPE FROM ...DELIMITED date-format question.
Posted: Fri Sep 07, 2012 11:12 AM

Dear Marc Vanzegbroeck,

Try use numeric for date with format YYYYMMDD ,

like :

11795129,20120731,42,9,"","Laadbrug",8,1,0,0.00

Thank

kok

Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: APPE FROM ...DELIMITED date-format question.
Posted: Fri Sep 07, 2012 11:16 AM

Thanks for the reply, but the problem is that I can't change this, because it's a CSV-file created by an SQL-command.
I can't find how how to change the format in MySQL in an 'INTO OUTFILE' command.
So I need to solve this with Harbour..

Regards,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: APPE FROM ...DELIMITED date-format question.
Posted: Fri Sep 07, 2012 12:03 PM

Hi solved it with a workaround by first reading the file into a memofield and remove all '-' with a STRTRAN, and save it again.

Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite

Continue the discussion