[Thread Prev][Thread Next][Index]

Re: [ferret_users] data count



Try like this

repeat/range=1:12/name=ll (;\
                say `ll`;\
                ;\
                ;\ ! Array holds your filename in a directory
                ;\
                let dir_file_array = { spawn: 'ls 2013.0`ll`/*.nc' };\
                ;\
                ;\ ! Array length using wc
                let arr_len        = { spawn: 'ls 2013.0`ll`/*.nc | wc -l'};\
                ;\
                ;\ ! You can remove these lines..
                list `arr_len`; list dir_file_array;\
                ;\
                ;\
                ;\ ! If files exists then arr_len will be greater than zero process further...
                IF `arr_len` THEN;\
                    repeat/range=1:`arr_len`/name=dd (;\
                                        let infile = dir_file_array[i=`dd`];\
                                        use `infile`;\
                                        show data;\
                                        can data/all;\
                                     );\
                ENDIF;\
              )

--
Akshay Hegde,                                    
Forum Advisor                                       
The Unix and Linux Forum Users                    
http://www.unix.com                              
http://in.linkedin.com/pub/akshay-hegde/59/b3/b1b




On Fri, Jul 11, 2014 at 3:50 PM, Gopal Mondal <gopalmondal18@xxxxxxxxx> wrote:
Using FERRET command how can I have the number of data in a folder with *.nc extension? There are 12 sub-folders in the folder. I want to use the files belongs to in each of them.
  I use the following command:

repeat/range=1:12/name=ll ( ;\
LET a = {"dummy", SPAWN:"/2013.0`ll`/ls *.nc"} ;\
LET nfiles = `a,RETURN=IEND` ;\
repeat/range=1:`nfile`/name=dd ( let dummy=a[i=`dd`]; use `dummy`; sh da; can da/all) ;\)

but not giving any result,
output is:
**ERROR: command syntax: unpaired quotation marks, grave accent or brackets

Please help any one..
thanks is adv..
Gopal


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement