<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    You don't need GrADS to do that ..<br>
    use wgrib2 to do it, I use it just like your describing<br>
    <pre class="moz-signature" cols="72">-Jeff Lake
MichiganWxSystem.com
WeatherMichigan.net
TheWeatherCenter.net
GRLevelXStuff.com</pre>
    <br>
    On 11/23/2011 12:40 PM, Alireza Azargoun wrote:
    <blockquote
cite="mid:CAKuuxT5OVCixS8bCi9wu=s82mz=VGb+rD7HPB9gVcOfHCou0cA@mail.gmail.com"
      type="cite">Tnx jeff. <br>
      <br>
      I explained the problem in a wrong way. I don't have any problem
      with opening the files. i used g2ctl and gribmap( I already
      created CTLs and IDXs for all files)&nbsp; and&nbsp; I can easily read data
      from a file or maybe 10 files. but there are 200 files. and I need
      a :<br>
      1- while loop to open the files. ( can anybody tell me why "while"
      is not working)<br>
      2- I need to learn how to write results and variables in a text
      file!<br>
      <br>
      <br>
      <br>
      <br>
      <div class="gmail_quote">On Wed, Nov 23, 2011 at 9:00 PM, Joey
        Woodson <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:instantweathermaps@gmail.com">instantweathermaps@gmail.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex;">g2ctl works
          just as well with the grib2 files.
          <div>
            <div class="h5"><br>
              <br>
              <div class="gmail_quote">On Wed, Nov 23, 2011 at 11:24 AM,
                Jeff Duda <span dir="ltr">&lt;<a moz-do-not-send="true"
                    href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>&gt;</span>
                wrote:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">My
                  experience with grib2 files is to use convgrb to
                  convert them to grib1 files, then use <a
                    moz-do-not-send="true" href="http://grib2ctl.pl"
                    target="_blank">grib2ctl.pl</a> to get a control
                  file for each converted grib1 file.&nbsp; You can do that
                  using a C-shell loop.&nbsp; Once you do that, you can use a
                  while loop in a Grads script (not at the command
                  prompt), to open each individual file and print the
                  data to a text file using <a moz-do-not-send="true"
href="http://cookbooks.opengrads.org/index.php?title=Recipe-002:_Saving_GrADS_variable_data_to_a_text_file"
                    target="_blank">fprintf</a> .<br>
                  <br>
                  Jeff Duda<br>
                  <br>
                  <div class="gmail_quote">
                    <div>
                      <div>On Wed, Nov 23, 2011 at 10:55 AM, Alireza
                        Azargoun <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:alireza.azargoun@gmail.com"
                            target="_blank">alireza.azargoun@gmail.com</a>&gt;</span>
                        wrote:<br>
                      </div>
                    </div>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div>
                        <div>
                          Dear GrADS users<br>
                          Hi everybody<br>
                          <br>
                          I have about 200 grib2 files ( 1.grb2 ~
                          200.grb ) . i need to read a temperature of a
                          city (lat, lon, lev, time are constant in all
                          files) . how i can read this files using a
                          while loop!?&nbsp; ( I receive this error when i
                          write a while. Unknown Command: while )<br>
                          &nbsp;and how can i write these data to a text
                          file!? I've searched all grads option for a
                          command that writes variables in a text file!
                          but i couldn't find it!<br>
                          <br>
                          Thanks in advance,<br clear="all">
                          Alireza <br clear="all">
                          Sharif University of Technology<br>
                          <br>
                          <br>
                        </div>
                      </div>
                      _______________________________________________<br>
                      gradsusr mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:gradsusr@gradsusr.org"
                        target="_blank">gradsusr@gradsusr.org</a><br>
                      <a moz-do-not-send="true"
                        href="http://gradsusr.org/mailman/listinfo/gradsusr"
                        target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
                      <br>
                    </blockquote>
                  </div>
                  <span><font color="#888888"><br>
                      <br clear="all">
                      <br>
                      -- <br>
                      Jeff Duda<br>
                      Grad student - PhD, Meteorology<br>
                      University of Oklahoma School of Meteorology -
                      Center for Analysis and Prediction of Storms<br>
                      <br>
                    </font></span><br>
                  _______________________________________________<br>
                  gradsusr mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
                  <a moz-do-not-send="true"
                    href="http://gradsusr.org/mailman/listinfo/gradsusr"
                    target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
                  <br>
                </blockquote>
              </div>
              <br>
              <br clear="all">
              <br>
              -- <br>
              <br>
            </div>
          </div>
          <a moz-do-not-send="true"
            href="http://www.instantweathermaps.com" target="_blank">http://www.instantweathermaps.com</a><br>
          <br>
          <br>
          _______________________________________________<br>
          gradsusr mailing list<br>
          <a moz-do-not-send="true" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
          <a moz-do-not-send="true"
            href="http://gradsusr.org/mailman/listinfo/gradsusr"
            target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
          <br>
        </blockquote>
      </div>
      <br>
      <br clear="all">
      <br>
      -- <br>
      Alireza Azargoun<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
    </blockquote>
  </body>
</html>