help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Special key in csv output


From: Suleyman Demirel
Subject: Re: [Help-glpk] Special key in csv output
Date: Thu, 21 Oct 2010 12:54:53 -0400

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 <address@hidden> 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
address@hidden
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
_________________________________________

reply via email to

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