Total record count of all the file present in a directory
Hi All ,
We need one help on the below requirement.We have multiple pipe delimited .txt file(around 100 .txt files) present on one directory.We need the total record count of all the files present in that directory without header.File format as below :
for one file ,we can get the record count like below :
Can anyone kindly help me how to get total record count of all the .txt files present in that directory without header.Any help on this regard will be appreciated.Thanks !
Apologies if I have missed anything here, I think OP has requested to remove the very first line(header) from the count. That is why I removed it in END section of my code.
Yes, I missed the extra requirement to ignore the header record.
Can we be sure that either:-
the files all have the same header?
no files will be zero bytes?
For the former, we could:-
For the latter (if the headers are different) we could perhaps:-
Would either of these work? I'm not sure on it's performance versus awk though.
Hi,
file1.txt
AAA
BBB
CCC
DDD
file2.txt
abc|AAA|AAAabcbcs|fnwufnq
bca|nwruqf|AAA|fwfwwefwef
fmimwe|BBB|fnqwufw|wufbqw
wcdbi|CCC|wefnwin|wfwwf
DDD|wabvfav|wqef|fwbwqfwfe
i need the count of rows of file1.txt present in the file2.txt
required output:
AAA 2 (10 Replies)
Dear all,
I have a directory consisted of files in .jpg, .jpeg etc..all of them are image
20140411030143_62811159403_92886.jpg 5/11/2014 15:01 197K
20140415024737_62811618747_116460.jpg 4/15/2014 14:47 17K
20140415031003_62811618747_109192.jpg 4/17/2014 15:10 17K... (4 Replies)
Need unix commands to delete records from one file if the same record present in another file...
just like join ... if the record present in both files.. delete from first file or delete the particular record and write the unmatched records to new file..
tried with grep and while... (6 Replies)
Hi,
I have a script which creates and modifies a csv file.
I have managed to do everything I need to do apart from 1 thing. I need to append a trailer record to the file. I need this line to hold the total of an entire column of the csv file (skipping the 1st line which is a header).
Can... (2 Replies)
how to count the total number of lines of all the files under a directory using perl script..
I mean if I have 10 files under a directory then I want to count the total number of lines of all the 10 files contain. Please help me in writing a perl script on this. (5 Replies)
Hi All,
I'm developing a FTP script as below:
ftp -v -n <IP_ADDRESS> << EOF
user avery jSqaqUU2
lcd /directory/folder/
ascii
prompt
mget *
bye
EOF
I would like to enhance the script to count the total file downloaded. For example, once the script run i want the message "Total <n>... (1 Reply)
hi gurus,
I am having a file containing a list of tables.i want to find the count of records inside thes tables.
for this i have to connect into database and i have to put the count for all the tables inside another file i used the following loop once all the tablenames are inside the file.
... (1 Reply)