How to count different id from a files?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to count different id from a files?
# 1  
Old 01-31-2015
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  
Old 01-31-2015
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:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

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. Shell Programming and Scripting

Count for only todays files.

Hi, I unable to find the direct command get the total count for the below files with today date. ls -lrt c90.txt n5.txt t1.txt k3.txt h9.txt s1.txt n2.txt a123.txt -rw-rw-r-- kkk klkl 980 Apr 26 19:00 c90.txt -rw-rw-r-- kkk klkl 80 Apr 26 19:00 n5.txt -rw-rw-r-- kkk klkl 12890 Apr 26... (3 Replies)
Discussion started by: onesuri
3 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

Display the count of files

I am new to shell programming. Can anyone help me out with anyone of these? Display a count of the number of regular files, the number of symbolic links, the number of sub-directories, the number of block-special files, and the number of character-special files in the directory. I don't... (4 Replies)
Discussion started by: wayne1411
4 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
Login or Register to Ask a Question