help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Mathprog > SQLite/MySQL > GNUPlot - (Graphing LP and MIP


From: glpk xypron
Subject: Re: [Help-glpk] Mathprog > SQLite/MySQL > GNUPlot - (Graphing LP and MIP results)
Date: Fri, 11 Jun 2010 20:54:06 +0200

Hello Nigel,

> Sadly the output from glpk is not XML, but I have a program written in
> Ruby that converts csv to XML. Or it did, perhaps it will need changing 

You can easily output XML from glpk using printf, see example below.

The same way you could create an Excel MHTML file. With multiple
worksheets if you want.

Best regards

Xypron

# filename
param file, symbolic := 'random.xml';
# generate some data
set I := 1..10;
param p{I} := Uniform01();
# output data to xml
printf '<?xml version="1.0" encoding="ISO-8859-1"?>' > file;
printf '<resultset date="%s">',time2str(gmtime(),"%FT%TZ") >> file;
for {i in I}
  printf '<random index="%i">%g</random>',i,p[i] >> file;
printf '</resultset>' >> file;
end;

-- 
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]