Export from Excel/CSV to DBF

HMG Samples and Enhancements

Moderator: Rathinagiri

RPC
Posts: 281
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: Export from Excel/CSV to DBF

Post by RPC »

mol wrote: Tue Feb 21, 2017 6:23 am if you want to save excel file before quitting, you shoud use
oExcel:Save()
Hi mol
Thanks. It works :D . Though right now I do not require to save excel file maybe in future I might require when I convert DBF files to excel.
It is quite thoughtful of you give this command(oExcel:save()) also.
RPC
Posts: 281
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: Export from Excel/CSV to DBF

Post by RPC »

Rathinagiri wrote: Tue Feb 21, 2017 6:59 am Is that an .xlsx file or .xls file?

If that is an .xlsx file, then we can use xml library to directly extract data from the file. We don't even require Excel and the process will be so fast.
Hi Rathinagiri
I can have *.xlsx file instead of *.xls file. Can you please elaborate on process of converting from *.xlsx using xml library.
Thanks
RPC
Posts: 281
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: Export from Excel/CSV to DBF

Post by RPC »

Hi KDJ
Thanks for these links.
I will check them.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Export from Excel/CSV to DBF

Post by Rathinagiri »

.xlsx files are simply zip files. You can uncompress them and see the contents of the directory structure and files. By Harbour XML libraries you can navigate through the data file using the tags.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
RPC
Posts: 281
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: Export from Excel/CSV to DBF

Post by RPC »

Thanks Rathinagiri.
Can you pls provide some link/docs from where I can learn about Harbour XML libraries.
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Export from Excel/CSV to DBF

Post by mol »

You can download harbour source and you will find samples about xml libraries.
RPC
Posts: 281
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: Export from Excel/CSV to DBF

Post by RPC »

Hi mol
Sorry couldn't find samples about xml libraries. Can you give exact path/link.
Thanks
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Export from Excel/CSV to DBF

Post by mol »

I'm posting from my phone today, but I'll find it tomorrow.
I've unzipped .Xlsx file, but, it will hard work to export to this file in my opinion. There was solution to work with excel files without excel on this forum - try to search.
But - if you have excel installed, the simplest way will be using activex (IMHO :-))
RPC
Posts: 281
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: Export from Excel/CSV to DBF

Post by RPC »

Hi mol
I have excel installed. I am trying to use *.xlsx because Rathinagiri said these files will be faster.
Pls post on xml libraries whenever possible for you.
Thanks
Post Reply