[ncl-talk] systenfunc_ncl reading files

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Mon Apr 19 10:07:42 MDT 2021


Only fine tuning...

wildcard1 = "191001_2019101[5-9].nc"
wildcard2 = "191001_2019102[0-9].nc"
files = systemfunc ("ls -1 " + wildcard1 + " " + wildcard2)


On Mon, Apr 19, 2021 at 9:33 AM Dennis Shea via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Likely,  there are better ways but the following should work
>
> fnam159 = *systemfunc*("ls 191001_2019101[5-9].nc")
> fnam209 = *systemfunc*("ls 191001_2019102[0-9].nc")
>
> fnam = *array_append_record*
> <http://www.ncl.ucar.edu/Document/Functions/Contributed/array_append_record.shtml>
> (fnam159, fnam209, 0)
> print(fnam)
>
> ===
>
>
> On Mon, Apr 19, 2021 at 8:45 AM LIU Chang via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>> Dear all,
>>
>> I am trying to reading some netcdf files. These files names are
>> 191001_20191015, 191001_20191016, ... 191001_20191029.
>> When I code *files = systemfunc("ls "+diri+"191001_201910[15:29].nc")*
>> It will print 191001_20191010, 191001_20191011, ... 191001_20191029.
>> Would you mind helping me how to choose the files from number 15 to 29.
>>
>> Thank you very much!
>> Chang
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210419/926f1c11/attachment.html>


More information about the ncl-talk mailing list