I guess this goes back to an earlier question that I was asking. If it were
possible to define a variable (such as a counter) and keep updating its
value (counter = counter+1), you cold have used printf command to write data
to csv, rather than using the table command.

On Thu, Oct 21, 2010 at 12:37 PM, Andrew Makhorin <[email protected]> wrote:

> > I am using the standalone GLPK solver and I extract outputs into csv
> file.
> > Would anyone have an idea how to achieve the following?:
> >
> > In the table:
> > table result {t in TRUCK:sum{s in STOCK}load[s,t]>0} OUT "CSV"
> > ".output.csv": (etc)
> >
> > I would like to have a field with numbers going 1, 2, 3... as far as the
> > table reaches. Please note that load[s,t] is a variable, so only at the
> end
> > of the calculation it is clear, which t in TRUCK will be included in the
> > output.
> >
> > I will be happy for any advice.
>
> There is no direct way to do this. If your intent is to read that csv
> file later in another model with the row numbers provided, you can use
> the fake field named RECNO, which is supported by the csv and dbf table
> drivers for input tables. In particular, you may use an auxiliary model
> that reads the csv file using RECNO and writes complete data to another
> csv file.
>
>
> _______________________________________________
> Help-glpk mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-glpk
>



-- 
_________________________________________
Suleyman Demirel - Office: (734) 647-3167

PhD Candidate in Operations Management
Stephen M. Ross School of Business
University of Michigan, Ann Arbor
Web: http://www.umich.edu/~sdemirel
_________________________________________
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to