<div dir="ltr"><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Thank you Guido for the fast response.</div><div dir="ltr"><br></div><div dir="ltr">I got it already. I used the <b><i>str_get_cols</i></b> to accomplish this.</div><div dir="ltr"><br></div><div dir="ltr"><br></div><div>Sincerely,</div><div><br></div><div>Lyndz</div><div><br></div><div dir="ltr"><div><br></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Sep 25, 2017 at 4:06 PM, Guido Cioni <span dir="ltr"><<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Yes there is,<div>see here <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/str_sub_str.shtml" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>str_sub_str.shtml</a> and here <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/str_split_by_length.shtml" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>str_split_by_length.shtml</a>. <br><div><blockquote type="cite"><div><div class="h5"><div>Il giorno 25 set 2017, alle ore 07:20, Lyndon Mark Olaguera <<a href="mailto:olagueralyndonmark429@gmail.com" target="_blank">olagueralyndonmark429@gmail.<wbr>com</a>> ha scritto:</div><br class="m_8946337202246055168Apple-interchange-newline"></div></div><div><div><div class="h5"><div dir="ltr"><div><div class="m_8946337202246055168gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear NCL-experts,</div><div><br></div><div>I am trying to read and process multiple csv files. Here is my script:</div><div><br></div><div><br></div><div><div>begin</div><div>   diri     = "./"</div><div>   files     = systemfunc("ls *.csv")</div><div>   numfiles = dimsizes(files)</div><div>   do ifil  = 0,numfiles-1</div><div>     lines    = asciiread(files(ifil),-1,"<wbr>string")</div><div>     data        = lines(1:)</div><div>     ;print(data)</div><div>     rain        = tofloat(str_get_field(data,1,"<wbr>,"))</div><div>;;****************************<wbr>***********************</div><div>;;Apply 1-2-1 running average (three pentads)</div><div>;;****************************<wbr>************************</div><div>  x = wgt_runave(rain, (/0.25, 0.50, 0.25/), 0)</div><div>  x@_FillValue = -9999</div><div>;;****************************<wbr>************************</div><div>;;Save output to a csv file</div><div>;;****************************<wbr>************************</div><div>  flname = files(ifil)+"_filt.csv"</div><div>  asciiwrite(flname,x)</div><div>  end do</div><div>end</div></div><div><br></div><div><br></div><div>Question:</div><div><br></div><div>[1] The output of this script is like this:</div><div><b><br></b></div><div><b>sg_X1980.csv_filt.csv</b><br></div><div><b><br></b></div><div>I want the output to be like : sg_X1980_filt.csv</div><div><br></div><div>Is there a way to "cut" or "select" specific strings from the input filename and use it for the output filename. </div><div><br></div><div>I'll appreciate any help.</div><div><br></div><div>Sincerely,</div><div><br></div><div>Lyndz</div><div><br></div><div><br></div><div><br></div></div></div></div></div></div></div></div></div></div>
</div></div></div>
______________________________<wbr>_________________<br>ncl-talk mailing list<br><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div></div>