# \[AMPL 25070\] Removing the gurobi status from Tables

**URL:** <https://discuss.ampl.com/t/ampl-25070-removing-the-gurobi-status-from-tables/1992>\
**Category:** Google Group Mirror\
**Created:** [November 25, 2024, 3:00pm UTC](https://discuss.ampl.com/t/ampl-25070-removing-the-gurobi-status-from-tables/1992 "2024-11-25T15:00:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AMPL\_Google\_Group](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@AMPL\_Google\_Group](https://discuss.ampl.com/u/AMPL_Google_Group)\
**Post date:** [November 25, 2024, 3:00pm UTC](https://discuss.ampl.com/t/ampl-25070-removing-the-gurobi-status-from-tables/1992/1 "2024-11-25T15:00:02Z")

</div>

Hello everyone,

I created a table in gurobi with a for loop, but that table doesnt look that beautyful with the gurobi status in it.

Thats my run data:

```auto
reset;
model 'C:\Users\anwar\Desktop\AMPL\models\datei.mod\datei.mod\A3.mod'
data 'C:\Users\anwar\Desktop\AMPL\models\datei.mod\datei.mod\A3.dat'

option solver gurobi;

# Parameter für Schrittweite und Endkapazität
# Parameter für die Kapazitätserhöhung

param step := 10; # Schrittweise Erhöhung der Kapazität um 10
param C2 := 200;

# Ausgabeheader für die Tabelle

printf "%-12s | %-15s | %-20s\n", "Kapazität", "Lösung existiert", "Zielfunktionswert";

# Schleife zur Kapazitätserhöhung von C bis 2*C

repeat {

   solve; # CLSP mit aktueller Kapazität lösen

   # Überprüfen, ob eine zulässige Lösung existiert
   if solve_result = 'optimal' then {

      # Wenn Lösung existiert, formatierten Zielfunktionswert drucken
      printf "%-12d | %-15s | %-20.2f\n", C[1], "Ja", costs;

      } else {

      # Wenn keine Lösung gefunden wurde, drucke Kapazität und "Keine Lösung"
      printf "%-12d | %-15s | %-20s\n", C[1], "Nein", "N/A";
   }

   # Kapazität schrittweise um 'step' erhöhen
   let {b in 1..T} C[b] := C[b] + step;

} while C[1] <= 200; # Schleife bis maximaler Kapazität erreicht

display 'C:\Users\anwar\Desktop\AMPL\models\datei.mod\datei.mod\A3.solve'

```

Is it possible to remove the gurobi status that comes with the solution in the console? For example:

```auto
Gurobi 11.0.3: Gurobi 11.0.3: optimal solution; objective 1630
36 simplex iterations
1 branching node

```

I don’t want these in my table, only the row and column.

Thanks in advance.  
Anwar

---

<div class="post-metadata">

**Author:** ![4er](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/4er/32/530_2.png) [@4er](https://discuss.ampl.com/u/4er)\
**Post date:** [February 17, 2025, 3:58am UTC](https://discuss.ampl.com/t/ampl-25070-removing-the-gurobi-status-from-tables/1992/2 "2025-02-17T03:58:44Z")

</div>

The solver’s result message, showing the optimal value and the numbers of iterations and nodes, can be suppressed by executing this AMPL statement before solving:

```auto
option solver_msg 0;

```

However, in some cases, other output may “leak” out of the solver. To remove that output, _ **also** _ redirect the “solve” output to the system null file, like this:

```auto
solve >NUL; # if using Windows
solve >/dev/null; # if using Linux or macOS

```

---

<div class="post-metadata">

**Author:** ![AMPL\_Google\_Group1](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@AMPL\_Google\_Group1](https://discuss.ampl.com/u/AMPL_Google_Group1)\
**Post date:** [February 17, 2025, 4:01am UTC](https://discuss.ampl.com/t/ampl-25070-removing-the-gurobi-status-from-tables/1992/3 "2025-02-17T04:01:48Z")

</div>

Your question has been moved to our new user forum at [discuss.ampl.com](http://discuss.ampl.com), and a response has been posted there. To see the response, use this link:

[https://discuss.ampl.com/t/ampl-25070-removing-the-gurobi-status-from-tables/1992/2](https://discuss.ampl.com/t/ampl-25070-removing-the-gurobi-status-from-tables/1992/2)

To reply, click the red “Reply” button that follows the response. (Do not send an email reply to this message.)
