How to count different id from a files?


 
Thread Tools Search this Thread
# 1  
How to count different id from a files?

Hi Guys,

Please help for counting different task_id:-
file name is: sms_push_123.ac:011:045

file records:
Quote:
your no is received: from files sms_push_task_id_01-12345.csv
your no is received: from files sms_push_task_id_01-13345.csv
your no is received: from files sms_push_task_id_01-14345.csv
your no is received: from files sms_push_task_id_02-15345.csv
your no is received: from files sms_push_task_id_02-12145.csv
your no is received: from files sms_push_task_id_02-12245.csv
your no is received: from files sms_push_task_id_02-12445.csv
your no is received: from files sms_push_task_id_03-12445.csv
your no is received: from files sms_push_task_id_03-12445.csv
your no is received: from files sms_push_task_id_03-12445.csv
your no is received: from files sms_push_task_id_03-12445.csv
your no is received: from files sms_push_task_id_03-12445.csv
your no is received: from files sms_push_task_id_04-12445.csv
your no is received: from files sms_push_task_id_04-12445.csv
your no is received: from files sms_push_task_id_04-12445.csv
your no is received: from files sms_push_task_id_04-12445.csv
Now we need to output like:
Quote:
3 task_id_01
4 task_id_02
5 task_id_03
4 task_id_04
# 2  
You had a close solution handed on a silver plate in https://www.unix.com/302933592-post4.html. Why don't you adapt that to your actual problem?
These 2 Users Gave Thanks to RudiC For This Post:
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script for field wise record count for different Files .csv files

Hi, Very good wishes to all! Please help to provide the shell script for generating the record counts in filed wise from the .csv file My question: Source file: Field1 Field2 Field3 abc 12f sLm 1234 hjd 12d Hyd 34 Chn My target file should generate the .csv file with the... (14 Replies)
Discussion started by: Kirands
14 Replies

2. Shell Programming and Scripting

Error files count while coping files from source to destination locaton as well count success full

hi All, Any one answer my requirement. I have source location src_dir="/home/oracle/arun/IRMS-CM" My Target location dest_dir="/home/oracle/arun/LiveLink/IRMS-CM/$dc/$pc/$ct" my source text files check with below example.text file content $fn "\t" $dc "\t" $pc "\t" ... (3 Replies)
Discussion started by: sravanreddy
3 Replies

3. UNIX for Dummies Questions & Answers

Finding the files and count then

Hi i was trying to find the files which are not older than one day and copy them to other location . but i need to count the number of files and the copy them if the count is matches my number A=`find $SOURCE/* -type f -mtime -1 ` in the code above i need to count the number of file A has... (8 Replies)
Discussion started by: vikatakavi
8 Replies

4. Shell Programming and Scripting

Count Files

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. ... (4 Replies)
Discussion started by: clammy
4 Replies

5. UNIX for Dummies Questions & Answers

Count number of files in directory excluding existing files

Hi, Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time.. Thanks (3 Replies)
Discussion started by: ammu
3 Replies

6. Shell Programming and Scripting

Count todays created files and old files

Hello experts, I used following approach to get listing of all files of remote server. Now I have remote server file information on same server. I am getting listing in the output.txt I want to count today's created files and old files. I want to compare the numbers... (11 Replies)
Discussion started by: dipeshvshah
11 Replies

7. Shell Programming and Scripting

Count of files in directories

Hi, I have a requirement to find out the count of files in directories. I can do this very well by goind to each directory and then ls -lrt | wc -l. But I need to do it for hundreds of directories/sub-directories. I tried with this - for i in `ls -F | grep '/$'`; do `echo "$i"`| ls -lrt... (2 Replies)
Discussion started by: unx100
2 Replies

8. Shell Programming and Scripting

Count files in every subdirectory

Hi if anyone could help me :) I did a lot of search and 70% of answer is "how to count files in all subdirectories". A basic problem for me is how to count files in every subdirectory separately then sort it by number of files For example: dir1 file1 file2 subdir11 dir2 dir3 ... (3 Replies)
Discussion started by: yorryk
3 Replies

9. Shell Programming and Scripting

count of files

How to count the number of files in a directory. Thanks Mahalakshmi.A (13 Replies)
Discussion started by: mahalakshmi
13 Replies

Featured Tech Videos