Hi,
how do i count all the files present in Unix directory, but not in the sudirectory from BODI.there are three files present in my Unix directory.
currently i am using following syntax:
$G_File_Count = exec( ‘ls | ls -F | grep -v / | wc -l’, ‘/bo/vikash/files/temporary’ ,2);
but it is returning null.
how ever when i checked in the Unix command prompt, “ls | ls -F | grep -v / | wc -l” is worknig fine and returning desired result. but i am calling from BODI, it is returning null.
can any one help me out???
fp = r'C:\Documents and Settings\jlb943\Desktop\testMe'
from os import listdir,path
lstFiles = [n for n in listdir(fp) if path.isfile(fp + '\\' + n) and n.upper().startswith('ATW') and n.upper().endswith('.TXT')]
print len(lstFiles)