<div dir="ltr"><div><div>Some new CSV examples have been created:<br><br><a href="http://www.ncl.ucar.edu/Applications/read_csv.shtml">http://www.ncl.ucar.edu/Applications/read_csv.shtml</a><br><br></div>See csv_6, csv_7 and csv_8<br><br></div>Good luck<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 24, 2015 at 3:37 AM, Karin Meier-Fleischer <span dir="ltr"><<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi Adv,<br>
<br>
if you use the new version of ncl 6.3.0 than you can write the
wanted data to a new string array using str_match_ic_regex:<br>
<br>
<tt> seldata = str_match_ic_regex(strs,"CROSBY ND US") ;--
NEW available in version 6.3.0</tt><tt> and later</tt><br>
<tt> print(seldata)</tt><br>
<br>
---><br>
<br>
<tt>Variable: seldata</tt><tt><br>
</tt><tt>Type: string</tt><tt><br>
</tt><tt>Total Size: 8024 bytes</tt><tt><br>
</tt><tt> 1003 values</tt><tt><br>
</tt><tt>Number of Dimensions: 1</tt><tt><br>
</tt><tt>Dimensions and sizes: [1003]</tt><tt><br>
</tt><tt>Coordinates: </tt><tt><br>
</tt><tt>Number Of Attributes: 1</tt><tt><br>
</tt><tt> _FillValue : missing</tt><tt><br>
</tt><tt>(0) COOP:321871,CROSBY ND
US,193101,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,10,-9999,-9999,12,12,41,-18,288,103,196</tt><tt><br>
</tt><tt>(1) COOP:321871,CROSBY ND
US,193102,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,2,-9999,-9999,4,4,40,-8,301,181,241</tt><tt><br>
</tt><tt>(2) COOP:321871,CROSBY ND
US,193103,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,25,-9999,-9999,99,50,50,-11,298,131,214</tt><tt><br>
</tt><tt>(3) COOP:321871,CROSBY ND
US,193104,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,0,-9999,-9999,0,0,83,12,578,293,436</tt><tt><br>
</tt><tt>(4) COOP:321871,CROSBY ND
US,193201,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,26,-9999,-9999,51,51,42,-28,168,-19,74</tt><tt><br>
</tt><tt>(5) COOP:321871,CROSBY ND
US,193202,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,40,-9999,-9999,52,60,66,-18,249,16,132</tt><tt><br>
</tt><tt>(6) COOP:321871,CROSBY ND
US,193203,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,20,-9999,-9999,50,50,51,-23,279,80,180</tt><tt><br>
</tt><tt>(7) COOP:321871,CROSBY ND
US,193204,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,73,-9999,-9999,115,5,72,20,534,308,421</tt><tt><br>
</tt><tt>(8) COOP:321871,CROSBY ND
US,193205,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,29,-9999,-9999,58,0,90,29,687,410,548</tt><tt><br>
</tt><tt>(9) COOP:321871,CROSBY ND
US,193206,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,249,-9999,-9999,594,0,87,47,759,544,652</tt><tt><br>
</tt><tt>(10) COOP:321871,CROSBY ND
US,193207,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,79,-9999,-9999,199,0,98,43,826,543,684</tt><tt><br>
</tt>.....<br>
<br>
Bye,<br>
Karin<br>
<br>
<br>
<div>Am 24.03.15 um 03:54 schrieb Adv:<br>
</div>
<blockquote type="cite"><div><div class="h5">
<div dir="ltr">
<div>
<div>
<div>Hi Ncl users,<br>
</div>
This is how my code look like. I would like to extract data
corresponding to station name and plot spatially only over
North Dakota region. Could some one help me to accomplish
this by extracting the data for different variables. I have
attached the input csv file with this mail. I have many csv
files like this. I just wanna loop in such a way all data
can be processed at once.<br>
</div>
Thanks,<br>
</div>
Adv<br>
<div>
<div>
<div>
<div><br>
begin<br>
flnm = "479615.csv"<br>
strs = asciiread(flnm,-1,"string")<br>
;print(strs)<br>
split_lines = str_split_csv(strs,",",2)<br>
nlines = dimsizes(split_lines(:,0))<br>
nfields = dimsizes(split_lines(0,:))<br>
header = split_lines(0,:)<br>
do n=0,nlines-1<br>
tf = isStrSubset(strs(n), "CROSBY ND US")<br>
if (tf) then<br>
field=(strs(n))<br>
do nf=0,nfields-1<br>
print(header(nf) + " : " +
str_join(split_lines(n,nf),", "))<br>
end do<br>
end if<br>
end do<br>
return<br>
<br>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Dipl. Geophys. Karin Meier-Fleischer
Visualization
Application Support
Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany
Phone: <a href="tel:%2B49%20%280%2940%20460094%20126" value="+4940460094126" target="_blank">+49 (0)40 460094 126</a>
Fax: <a href="tel:%2B49%20%280%2940%20460094%20270" value="+4940460094270" target="_blank">+49 (0)40 460094 270</a>
E-Mail: <a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>
URL: <a href="http://www.dkrz.de" target="_blank">www.dkrz.de</a>
Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784
</pre>
</div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>