Re: how to open files in different folders

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 28 2011 - 14:40:54 MST

Also .... examining the email archives

   http://www.ncl.ucar.edu/Support/talk_archives/2009/1930.html

Further, do you really want "0" and "00" ?

   imonth = sprinti("%0.2i", ispan(0,33,3))
   print(imonth)

(0) 00
(1) 03
...
(9) 27
(10) 30
(11) 33

On 11/28/2011 02:30 PM, Mary Haley wrote:
> You just forgot the "ls" in the "systemfunc" command:
>
>> add_1 = systemfunc("ls /home/lovecheese/DATA/2000/*"+"2000"+imonth(i*3)+"*.hdf")
>> add_2 = systemfunc("ls /home/lovecheese/DATA/2000/*"+"2000"+imonth(i*3+1)+"*.hdf")
>> add_3 = systemfunc("ls /home/lovecheese/DATA/2000/*"+"2000"+imonth(i*3+2)+"*.hdf")
>
>
> --Mary
>
> On Nov 28, 2011, at 11:12 AM, yikun liu wrote:
>
>> Hi,
>>
>> I want to open .hdf data files that are in different folders. Is there any Function or NCL Statement can help me with it?
>> another question. I use addfile and systemfunc to open specific files in one folder
>>
>> imonth=(/"0","00","03","06","09","12","15","18","21","24","27","30","33"/)
>> do i =1,4
>> if( i.lt.4)
>> add_1 = systemfunc("/home/lovecheese/DATA/2000/*"+"2000"+imonth(i*3)+"*.hdf")
>> add_2 = systemfunc("/home/lovecheese/DATA/2000/*"+"2000"+imonth(i*3+1)+"*.hdf")
>> add_3 = systemfunc("/home/lovecheese/DATA/2000/*"+"2000"+imonth(i*3+2)+"*.hdf")
>> f1 =addfile(add_1,"r")
>> f2 =addfile(add_2,"r")
>> f3 =addfile(add_3,"r")
>> else
>> end if
>> end do
>>
>> but it said Permission denied. What's the problem?
>>
>>
>>
>> Yikun
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Nov 28 14:41:00 2011

This archive was generated by hypermail 2.1.8 : Wed Nov 30 2011 - 19:52:47 MST