Importing data

This forum is for general support of Xbase++
Post Reply
Message
Author
skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Importing data

#1 Post by skiman »

Hi,

On a regular base I get datafiles from new customers to import and convert their data to use in my application. Normally they deliver XLS files.

I always convert them manually, I add the fieldnames in the first row, and I export to DBF. I was wondering if someone had a tool to do this?
Best regards,

Chris.
www.aboservice.be

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: Importing data

#2 Post by RDalzell »

Hi Chris,

I have used several converters from the below company, they are inexpensive and offer a trial for your review:

http://www.whitetown.com/xls2dbf/

Rick

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Importing data

#3 Post by rdonnay »

Why don't you use DC_Excel2WorkArea() ?
The eXpress train is coming - and it has more cars.

User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: Importing data

#4 Post by GeneB »

Can you provide an example of it's use? I can't find any documentation for DC_Excel2WorkArea()
I updated in April. Has it been added since?

GeneB

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Importing data

#5 Post by skiman »

Hi,

I will check the possibilities of it. The structure of these XLS files is always different.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Importing data

#6 Post by rdonnay »

For a sample, look in \exp19\samples\excel.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Importing data

#7 Post by Auge_Ohr »

skiman wrote:I always convert them manually, I add the fieldnames in the first row, and I export to DBF. I was wondering if someone had a tool to do this?
rdonnay wrote:DC_Excel2WorkArea() ... For a sample, look in \exp19\samples\excel.
i do find DC_Array2Excel() but not DC_Excel2WorkArea() ?

anyway, both are using Excel as activeX so the "Trick" is

Code: Select all

// select Data in Sheed
         oWorkBook:workSheets(1):usedRange:Select
// Row and Col
         numRows    := oWorkBook:workSheets(1):usedRange:Rows:Count
         numColumns := oWorkBook:workSheets(1):usedRange:Columns:Count
// build a empty Array with Row/Col Dimension
         FOR i := 1 TO numRows
            AADD(aExcel,ARRAY(numColumns))
         NEXT
// same as Get_Excel_Column_ID
         cEnde := ZAHL2CHR(numColumns)
// assing hole "marked" Sheed to Array
         aExcel := oSheet:range( "A1:"+cEnde+LTRIM(STR(numRows)) ):value
now you can modify Array aExcel as you like and you do not need a temporary DBF to import.
greetings by OHR
Jimmy

Post Reply