Jump to content

Recommended Posts

I wish everyone a healthy day.
 

Excel (Row1 =Date, Row2=Quantity)

     A............................B.........................C.......................

1...05-01-2021......05-02-2021.....05-03-2021

2...150..................... 200......................250

 

I need to import above datas into my table as below

Date.........................Qty

05-01-2021..........150

05-02-2021..........200

05-03-2021..........250

........

........

 

Could someone please show me how to do ?

Thank You
 

Share this post


Link to post

Export the Excel sheet as a CSV file which is a text file that you can easily parse with Delphi.

Or automate Excel from your Delphi application to get the cells.

Probably other solutions exists.

 

  • Like 1

Share this post


Link to post

If you have Excel installed where the program will run you can use the COM API to interact with Excel files from your Delphi app I think. I personally never used any of these but I know it can send E-mails with Outlook so I suppose you can use Excel too.

From there it's easy as a pie. Just do a loop, dataset.Append; dataset.FieldByName.AsString := excelcell; dataset.Post.

 

@FPiette has my preferred answer too. Just export to CSV / TSV (which I personally prefer) and it's really easy to parse those with Delphi.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×