<HTML>
<HEAD>
<TITLE>Re: [gradsusr] opening text file data</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Jennifer,<BR>
<BR>
Do you have to only output a single variable to each binary data file? &nbsp;I could see the utility of this to create line graphs within GrADS from text data. &nbsp;<BR>
<BR>
Robert LeeJoice<BR>
<BR>
<BR>
On 2/9/11 11:27 AM, &quot;Jennifer Adams&quot; &lt;<a href="jma@cola.iges.org">jma@cola.iges.org</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>James, <BR>
Before GrADS can handle your data, you need to convert it from text to binary. Try something like this: <BR>
<BR>
</SPAN></FONT><FONT SIZE="1"><FONT FACE="Courier, Courier New"><SPAN STYLE='font-size:9pt'>'open dummy.ctl'<BR>
file=7hA01.out.txt<BR>
nlinesinfile=755<BR>
i=1<BR>
'set gxout fwrite'<BR>
'set fwrite 7hA01.out.bin'<BR>
while (i&lt;=nlinesinfile)<BR>
&nbsp;res = read(file)<BR>
&nbsp;line2=sublin(res,2)<BR>
&nbsp;val = subwrd(line2,2)<BR>
&nbsp;'d 'val<BR>
&nbsp;i=i+1<BR>
endwhile<BR>
'disable fwrite'<BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
...dummy.ctl looks like this:<BR>
<BR>
</SPAN></FONT><FONT SIZE="1"><FONT FACE="Courier, Courier New"><SPAN STYLE='font-size:9pt'>dset foo<BR>
options template<BR>
undef -9.99e8<BR>
xdef 1 linear 1 1<BR>
ydef 1 linear 1 1<BR>
zdef 1 linear 1 1<BR>
tdef 755 linear 0Z01JAN1948 1mo<BR>
vars 1<BR>
foo 0 99 foo<BR>
endvars<BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
... and your new GrADS data set looks like this: <BR>
<BR>
</SPAN></FONT><FONT SIZE="1"><FONT FACE="Courier, Courier New"><SPAN STYLE='font-size:9pt'>dset ^7hA01.out.bin<BR>
undef -9.99e8<BR>
xdef 1 linear 1 1<BR>
ydef 1 linear 1 1<BR>
zdef 1 linear 1 1<BR>
tdef 755 linear 0Z01JAN1948 1mo<BR>
vars 1<BR>
var 0 99 var<BR>
endvars<BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
--Jennifer<BR>
<BR>
<BR>
<BR>
On Feb 7, 2011, at 10:48 AM, James Ciarlo` wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi,<BR>
<BR>
I have several text files such as the one I attached and I need to open them which GrADS but I cannot understand how to do so. Can someone help me please?<BR>
<BR>
James<BR>
&nbsp;&lt;7hA01.out.txt&gt;_______________________________________________<BR>
gradsusr mailing list<BR>
<a href="gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><BR>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
&nbsp;<BR>
</SPAN><FONT SIZE="1"><SPAN STYLE='font-size:9pt'>--<BR>
Jennifer M. Adams<BR>
IGES/COLA<BR>
4041 Powder Mill Road, Suite 302<BR>
Calverton, MD 20705<BR>
<a href="jma@cola.iges.org">jma@cola.iges.org</a><BR>
<BR>
<BR>
</SPAN></FONT><SPAN STYLE='font-size:11pt'> <BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_______________________________________________<BR>
gradsusr mailing list<BR>
<a href="gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><BR>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE>
</BODY>
</HTML>