I am trying to count number of record in a file and then append a trailer to that file.
Trailer should e in the format as below
T| <count of records>
count of records ---> this count should be one less than the actual count obtained, as the file will have a header.
Hi!
I just want to count number of files in a directory, and write to new text file, with number of files and their name
output should look like this,,
assume that below one is a new file created by script
Code:
Number of files in directory = 25
1. a.txt
2. abc.txt
3. asd.dat
----------------
----------------
----------------
----------------
----------------
----------------
25.
I try to count number of lines of a data.txt file and then if number of lines is greater than 1 then email me the file.
I could not find what is wrong with my code, hope you can point out the mistake i made
Code:
#!
Hello everyone, after a few days of inactivity i'm finally back!Anyhow, down to business...I am trying to find out how to display the current visible directory and file count (as one number), and also display the current directory size in my PS1.
I was wondering if anyone could help me with this problem:
Write a script called countFiles that takes two arguments, the initial directory and the number of levels and returns the count of all files (including directories) in the directories and subdirectories up to the number of levels.
Hi all,
I have a tab-delimited text file of size 10Mb. I am trying to count the number of lines using,
Code:
grep -c . sample.txt
or
Code:
wc -l < sample.txt
or
Code:
awk 'END {print NR}' sample.txt
All these commands shows the count as 1, which means they are reading only the first header line of the file.
to count the files in a directory.. having some pattern for some files.. but we dont know the pattern .. how to count than particular pattern files ...
example if a directory ha xx_1.txt xx_2.txt and yy_1.txt yy_2.txt the xx file should be count and yy files should be count.. but we dont know what is xx and yy
Hi
In my directory i have file of many days , i want to count the number of line of all the files of todays date. every file will have date component on it for eg.
hi I want to write a script which count the number of subdirectories in the current root directory that contain more than a specified number of files of a specific type. Is there an easy way to do this?
Thanks
Robert