APPE FROM ...DELIMITED date-format question.

APPE FROM ...DELIMITED date-format question.

Postby Marc Vanzegbroeck » 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

All fields are imported except the date.
I have tried to use
Code: Select all  Expand view
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
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: APPE FROM ...DELIMITED date-format question.

Postby kok joek hoa » 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
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: APPE FROM ...DELIMITED date-format question.

Postby Marc Vanzegbroeck » 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
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: APPE FROM ...DELIMITED date-format question.

Postby Marc Vanzegbroeck » 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
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 46 guests