help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] How can put/output my results in table format "txt" "csv" or


From: Noli Sicad
Subject: [Help-glpk] How can put/output my results in table format "txt" "csv" or "xBase"
Date: Wed, 8 Apr 2009 15:27:48 +1000

The result script (below) is working, however, I would like put these
results in table format in "txt" "cvs" or "xBase". Any idea how to
output these results into a file in "txt", "cvs" or xBASE rather
displaying it screen. Just one file with headers like this...

Period Ave_Age  Total_Vol Total_Cut_Vol  Carbon_Stand  Carbon_HWP
1
2
.
.
70

for {p in 1..Numyear} {
printf ' %2s %10.2f %10.2f %15.2f %15.2f %15.2f %15.2f %15.2f\n', p,
......

Putting at the end .....* 0.45 * 3.6667 else Yield[i,Maxyear]* 0.45 *
3.6667)} > "result.txt";
}

This one does not work only one line will be output as txt file

Any ideas how to do this??



printf '\n';
printf '######################################################\n';
printf '\n';
printf 'Carbon Summary 1\n';
printf '\n';
printf '######################################################\n';
printf '\n';

printf 
'Period\tArea\tAve_Age\tTotal_Vol\tTotal_Cut_Vol\tCarbon_Stand\tCarbon_HWP\tToTal_Carbon\n';

for {p in 1..Numyear} {
printf ' %2s %10.2f %10.2f %15.2f %15.2f %15.2f %15.2f %15.2f\n', p,
sum{i in CROPTYPE,j in 1..Maxyear+p-1: i != 'Bareland' and (i = 'SOO'
or i = 'SOD' or i = 'SORM' or i = 'SORI' or i = 'OTO' or i = 'OTD' or
i = 'OTRM' or i = 'OTRI' )}x[p,i,j],
if (sum{i in CROPTYPE,j in 1..Maxyear+p-1: i != 'Bareland' and (i =
'SOO' or i = 'SOD' or i = 'SORM' or i = 'SORI' or i = 'OTO' or i =
'OTD' or i = 'OTRM' or i = 'OTRI' )}x[p,i,j]) = 0 then 0 else ((sum{i
in CROPTYPE,j in 1..Maxyear+p-1: i != 'Bareland' and (i = 'SOO' or i =
'SOD' or i = 'SORM' or i = 'SORI' or i = 'OTO' or i = 'OTD' or i =
'OTRM' or i = 'OTRI' )}x[p,i,j]*j) / (sum{i in CROPTYPE,j in
1..Maxyear+p-1: i != 'Bareland' and (i = 'SOO' or i = 'SOD' or i =
'SORM' or i = 'SORI' or i = 'OTO' or i = 'OTD' or i = 'OTRM' or i =
'OTRI' )}x[p,i,j])),


sum{i in CROPTYPE,j in 1..Maxyear+p-1: i != 'Bareland' and (i = 'SOO'
or i = 'SOD' or i = 'SORM' or i = 'SORI' or i = 'OTO' or i = 'OTD' or
i = 'OTRM' or i = 'OTRI' )}x[p,i,j]*(if j < Maxyear then Yield[i,j]
else Yield[i,Maxyear]),
sum{i in CROPTYPE,j in 1..Maxyear+p-1: i != 'Bareland' and (i = 'SOO'
or i = 'SOD' or i = 'SORM' or i = 'SORI' or i = 'OTO' or i = 'OTD' or
i = 'OTRM' or i = 'OTRI' )}x[p,i,j]*(if j < Maxyear then (Yield[i,j]*
0.45 * 3.6667) else (Yield[i,Maxyear]* 0.45 * 3.6667) ),

sum{i in CROPTYPE,j in 1..Maxyear+p-1: i != 'Bareland' and (i = 'SOO'
or i = 'SOD' or i = 'SORM' or i = 'SORI' or i = 'OTO' or i = 'OTD' or
i = 'OTRM' or i = 'OTRI' )}x[p,i,j]*(if j < Maxyear then (Yield[i,j]*
0.45 * 3.6667) else (Yield[i,Maxyear]* 0.45 * 3.6667) ),

sum{i in CROPTYPE,j in 1..Maxyear+p-1: i != 'Bareland' and (i = 'SOO'
or i = 'SOD' or i = 'SORM' or i = 'SORI' or i = 'OTO' or i = 'OTD' or
i = 'OTRM' or i = 'OTRI' )}(if (p,i,j) in VALIDCUT then y[p,i,j] else
0)*(if j < Maxyear then Yield[i,j] * 0.45 * 3.6667 else
Yield[i,Maxyear]* 0.45 * 3.6667),

sum{i in CROPTYPE,j in 1..Maxyear+p-1: i != 'Bareland' and (i = 'SOO'
or i = 'SOD' or i = 'SORM' or i = 'SORI' or i = 'OTO' or i = 'OTD' or
i = 'OTRM' or i = 'OTRI' )}x[p,i,j]*(if j < Maxyear then (Yield[i,j]*
0.45 * 3.6667) else (Yield[i,Maxyear]* 0.45 * 3.6667) ) + sum{i in
CROPTYPE,j in 1..Maxyear+p-1: i != 'Bareland' and (i = 'SOO' or i =
'SOD' or i = 'SORM' or i = 'SORI' or i = 'OTO' or i = 'OTD' or i =
'OTRM' or i = 'OTRI' )}(if (p,i,j) in VALIDCUT then y[p,i,j] else
0)*(if j < Maxyear then Yield[i,j] * 0.45 * 3.6667 else
Yield[i,Maxyear]* 0.45 * 3.6667);
}

Thank you.

Noli




reply via email to

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