I have written a Bash script which stores the number of records(line count) in a file and File name which is present in the directory in a output.txt file.
The output.txt file is as below.
No.ofRecord FileName delimiter
563394 1--UnixfileName.txt 28
364794 2--UnixfileName.txt 28
785895 3--UnixfileName.txt 28
99778453 1--NextUnixFileName.txt 18
95645453 2--NextUnixFileName.txt 18
99745313 3--NextUnixFileName.txt 18
Required results
output.txt
No.ofRecord FileName delimiter
563394 1--UnixfileName.txt 28
364794 2--UnixfileName.txt 28
785895 3--UnixfileName.txt 28
99778453 1--NextUnixFileName.txt 18
95645453 2--NextUnixFileName.txt 18
99745313 3--NextUnixFileName.txt 18
TOTAL :
1714083 UnixfileName
295169219 NextUnixFileName
Note:
Sum the No.ofRecord if File name like UnixFileName
Sum the No.ofRecord if File name like NextUnixFileName.
Thanks in advance.