[gradsusr] Printing values to a text file

Jeff Duda jeffduda319 at gmail.com
Fri Mar 6 14:30:35 EST 2020


I think the problem is that you're not displaying a data field in your
code. It looks like you're telling Grads just to spit out a sequence of
integers. You don't need Grads for that. Also, the gxout print and prnopts
probably aren't meant to be used for that. You could easily just do

a = 1
while (a < 400)
 say a
 a = a + 1
endwhile

Then copy your screen to a text file, or just use grads -H [*logfile*] to
tell Grads to log commands + output to *logfile*

Jeff Duda

On Fri, Mar 6, 2020 at 11:47 AM Jan Ising <jising at aggies.ncat.edu> wrote:

> Hello,
>
> How would I display multiple values per line in a .txt file from a
> single-valued changing variable (see code)? Based on the code below it is
> currently displaying 1 value per line instead of 200 values per line:
>
>  'set gxout print'
> 'set prnopts %f 200 1'
> a = 0
>
> while (a < 400)
> a = a + 1
> dummy = write(test_output, a, append)
> endwhile
>
>
> Result is:
> 1
> 2
> 3
> 4
> 5
> ...
>
> Instead of:
> 1 2 3 4 5
> 6 7 8 9 10
>
> any help would be greatly appreciated
>
> -Thanks,
> Jon
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>


-- 
Jeff Duda, Research Scientist
University of Colorado Boulder
Cooperative Institute for Research in Environmental Sciences
NOAA/OAR/ESRL/Global Systems Division
Boulder, CO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20200306/31eab672/attachment.html>


More information about the gradsusr mailing list