Writing LP files
The command to write LP file format from the Interactive Optimizer prompts for options.
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 a type 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, you can 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 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,
CPLEX ignores subsequent file type information issued within the write command.
For example, CPLEX responds to the following command by writing an
LP format problem file:
write example.lp mps