Writing LP Files

When you enter the write command. the following message appears:

  Name of file to write:

Enter the problem name "example", and CPLEX will ask you to select from a list of options. For this example, choose LP. CPLEX displays a confirmation message, like this:

  Problem written to file 'example'.

If you would like to save the file with a different name, you can simply use the write command with the new file name as an argument. Try this, using the name example2. This time we avoid intermediate prompts by specifying an LP problem type, like this:

  write example2 lp

Another way of avoiding the prompt for a file format is by specifying the file type explicitly in the file name extension. Try the following as an example:

  write example.lp

Using a file extension to indicate the file type is the recommended naming convention. This makes it easier to keep track of your problem and solution files.

When the file type is specified by the file name extension, ILOG CPLEX ignores subsequent file type information issued within the write command. For example, ILOG CPLEX responds to the following command by writing an LP format problem file:

  write example.lp mps 

Previous Page: Selecting a Write File Format   Return to Top Next Page: Writing Basis Files