Thank you, I have one another quarries: that is if I want to omit ll=7,8 i.e. file of 2013.07 and 2013.08 sub folder are not necessary. then what to do? please help...thanks in adv...Gopal
On Fri, Jul 11, 2014 at 4:49 PM, Akshay Hegde <akshay.k.hegde@xxxxxxxxx> wrote:
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/b1bOn Fri, Jul 11, 2014 at 3:50 PM, Gopal Mondal <gopalmondal18@xxxxxxxxx> wrote:
Gopalthanks is adv..Please help any one..output is:but not giving any result,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.repeat/range=1:12/name=ll ( ;\
I use the following command:
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) ;\)
**ERROR: command syntax: unpaired quotation marks, grave accent or brackets