Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  Reading Data from an Excel File

    Posted Mon October 26, 2020 04:21 PM
    Hello Community members:

    I'm trying to read data from an Excel file to populate an instance of a combinatorial optimization problem. I'm using CP Optimizer as solver. I know how to do that when the Excel file is located in the same folder than the .mod and the .dat file, but now I need to read from an Excel file located in an arbitrary place on my C or D disk.

    It is possible to do that or is mandatory that the Excel file for reading data from must be in the same folder than .mod and .dat file?

    Thanks in advance

    F. Yuraszeck
    #DecisionOptimization


  • 2.  RE: Reading Data from an Excel File

    Posted Tue October 27, 2020 04:38 AM
    Hi,

    the spreadsheet can be anywhere you like.

    Let me give you an example:

    In the oil example you can see

    SheetConnection sheet("oilSheet.xls");

    Suppose I move this spreadsheet to c:/temp and rename it oilSheettemp.xls

    Then in may .dat

    SheetConnection sheet("c:/temp/oilSheettemp.xls");

    works fine

    regards


    ------------------------------
    ALEX FLEISCHER
    ------------------------------