John, After trail and error the following works for me but still has to be refined.
find . -type f | while read i; do echo -e "$(dirname ${i}}} | cut -b 3-) $(basename ${i}) $(wc -l ${i})" ; done | cut -d " " -f 1,2,3 1. All the folders that I am interested in are all starts with number 2. I don/t want to go in sub folders 3. Using the above script the results look like teh following 185 name.csv 6506 186 add.csv 480 187 31851513 65 188 add.csv 44131 189 add.txt 44131 Name 1692157077 the first column is the folder name the second column is the file name the last column is the count ****Row 3 and 5 must be excluded because they don't have proper file name and also the 5th column does not start with number. I want to split the output into two files File one contains only add* and file two should contain name*. I reach to my goal on teh fourth step. Here are thesteps #Step 1 find . -type f | while read i; do echo -e "$(dirname ${i}}} | cut -b 3-) $(basename ${i}) $(wc -l ${i})" ; done | cut -d " " -f 1,2,3 > xyz #Step 2 grep -e "Name" xyz |sort | uniq -c > X_Name #step 3 grep -e "Add" xyz |sort | uniq -c > X_Add #Step 4 join -1 2 -2 2 x_Name X_Add > Want_all ## 2 is the folder name , where the two files are joind together. Do you think there better way of doing this? -- View this message in context: http://gnu-bash.2382.n7.nabble.com/count-tp16675p16683.html Sent from the Gnu - Bash mailing list archive at Nabble.com.