<div dir="ltr"><div><div>Because you can combine string operands, You can combine the four variables that were in different operands into one operands, and print that whole string instead. Something like:<br><br></div>line.1=xlat.1+&#39; &#39;+x.lon.1+&#39; &#39;temp.1+&#39; &#39;ppt.1<br>
<br></div>Be sure to leave appropriate separator like spaces, or commas, depending whether you want to save in binary, text or csv.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 7, 2013 at 6:56 AM, Andrew Friedman <span dir="ltr">&lt;<a href="mailto:andfried@berkeley.edu" target="_blank">andfried@berkeley.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Uzair,<br>
<br>
I don&#39;t think that fprintf alone can make what you&#39;re looking for.<br>
<br>
I haven&#39;t done this, but two possible approaches come to mind:<br>
1. You can combine the output of different variables from fprintf using an external text processing utility such as awk.<br>
2. You can create a table from netcdf data directly using the NCO (netcdf operator) ncks:<br>
<a href="http://nco.sourceforge.net/nco.html#ncks-netCDF-Kitchen-Sink" target="_blank">http://nco.sourceforge.net/nco.html#ncks-netCDF-Kitchen-Sink</a> (see section 4.7.1: Filters for ncks)<br>
<br>
Can you describe more what you&#39;re using the table for? Others may be able to help with a better understanding of the specifics.<br>
<br>
Andrew<br>
<div><div class="h5"><br>
<br>
On Oct 6, 2013, at 10:18 AM, uzair manan &lt;<a href="mailto:uzair_july@hotmail.com">uzair_july@hotmail.com</a>&gt; wrote:<br>
<br>
&gt; GOOD MORNING EVERYONE:<br>
&gt;<br>
&gt; I&#39;ve simulated global data using a regional climate model.. The output it generates is in netcdf format. The output file contains four variables which are :-<br>
&gt; 1. Latitude (xlat)<br>
&gt; 2. Longitude (xlon)<br>
&gt; 3. Temperature (temp)<br>
&gt; 4. Precipitation (ppt)<br>
&gt;<br>
&gt; Now how can I generate, using fprintf or any other way, a single file that contains a template as shown below:- (FOR EXAMPLE)<br>
&gt;<br>
&gt; LATITUDE              LONGITUDE                  TEMPERATURE             PRECIPITATION<br>
&gt;<br>
&gt;     23                                 60                                       23                                        10mm<br>
&gt;     23.5                              60.5                                    26                                        26mm<br>
&gt;       .                                   .                                          .                                              .<br>
&gt;       .                                   .                                          .                                              .<br>
&gt;       .                                   .                                          .                                              .<br>
&gt;<br>
&gt; A format like above or anything similar to it will work. Please give an example<br>
&gt;<br>
&gt; Any help will be appreciated...<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Best regards<br>
&gt;<br>
&gt; Uzair Mannan<br>
&gt; Cell: +923323489950<br>
&gt; NED University of Engineering &amp; Technology<br>
&gt; Karachi, Pakistan<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; gradsusr mailing list<br>
&gt; <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
&gt; <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br>
<br>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div><br></div>