Want to write a script for mailing line count


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Want to write a script for mailing line count
# 1  
Old 02-16-2011
Power Want to write a script for mailing line count

Hi all,

I have a directory in which files are formed daily at certain time.files have certain naming convention for ex ..

Code:
File1TTT.DATddmmyyyyhrsminsec
File2TTT.DATddmmyyyyhrsminsec

I want to take their line count when they are formed and mail that line count.

Please help how to write a script which can take line count for different files above.

Last edited by joeyg; 02-16-2011 at 02:26 PM.. Reason: Isolated sample data inside codetags
# 2  
Old 02-16-2011
Making sure I understand this.
if you do
Code:
wc -l File*TTT.DAT*

will provide a listing of
lines filename
Is this what you are looking to email?
# 3  
Old 02-18-2011
First of all thanks for reply.


yaa i want to mail this only.

but the problem is there are several files and they keep on forming continuously.

for each file that has formed I have to login to putty and take the word count of each file manually.

So I have to automate this process to get this linecount in my mailbox as soon as each file is formed.

Suggest me which condition can i give and how to make my script waiting till all files are formed.

---------- Post updated at 03:17 PM ---------- Previous update was at 03:15 PM ----------

Quote:
Originally Posted by joeyg
Making sure I understand this.
if you do
Code:
wc -l File*TTT.DAT*

will provide a listing of
lines filename
Is this what you are looking to email?

actually i m looking for linecount i.e. number of lines in each file

wc -l File1TTT.DATDDMMYYYYHHMMSS
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count Segmentation fault and write to the file

Hi everyone Need to get version of npm application that have several output like this: root: nmp -version 10 root: nmp -version 10 root: nmp-new -version 3.1 root: nmp-old -version Segmentation fault count them , after that write to the file like this: 10 2 3.1 1 (1 Reply)
Discussion started by: indeed_1
1 Replies

2. Shell Programming and Scripting

Write a script for getout afew line and grep a define word

dear all Hi i want write a script can count number of my log file and every 5min run script for cgk log file for find a specific word such as Error for example in first 5 min we have 500 line in my log file and in second 5min we have 2500 line in my log file how can chk error word in my log... (4 Replies)
Discussion started by: Baber
4 Replies

3. Shell Programming and Scripting

Count the pipes "|" in line and delete line if count greter then number.

Hello, I have been working on Awk/sed one liner which counts the number of occurrences of '|' in pipe separated lines of file and delete the line from files if count exceeds "17". i.e need to get records having exact 17 pipe separated fields(no more or less) currently i have below : awk... (1 Reply)
Discussion started by: ketanraut
1 Replies

4. Shell Programming and Scripting

Compare file1 header count with file2 line count

What I'm trying to accomplish. I receive a Header and Detail file for daily processing. The detail file comes first which holds data, the header is a receipt of the detail file and has the detail files record count. Before processing the detail file I would like to put a wrapper around another... (4 Replies)
Discussion started by: pone2332
4 Replies

5. UNIX for Dummies Questions & Answers

Script to count character present in a line

Suppose i have multiple line like below in a file. ASDFAFAGAHAHAHA AGAHAHAJGAFAGAH AHAHAKAHAHAHAKA I need a bash script to count a character and also Also count the number of character present in each line . suppose for line 1: A=x, S=y, D=x and so on and total character=15. where x y and z is... (3 Replies)
Discussion started by: XXLMMN
3 Replies

6. Shell Programming and Scripting

Shell script to count number of ~ from each line and compare with next line

Hi, I have created one shell script in which it will count number of "~" tilda charactors from each line of the file.But the problem is that i need to count each line count individually, that means. if line one contains 14 "~"s and line two contains 15 "~"s then it should give an error msg.each... (3 Replies)
Discussion started by: Ganesh Khandare
3 Replies

7. Shell Programming and Scripting

d. Write a shell script to count the number of accounts which belong to particular primary

guys, I am new shelll scripting.. this a question on passt exam paper, I was trying to solve it , I can not. the question is as follow? a. Write a shell script to count the number of accounts which belong to particular primary group in a standard UNIX system which uses local... (1 Reply)
Discussion started by: gurmad
1 Replies

8. Shell Programming and Scripting

scripting - write a script that will count the number of times a particular word

hello everyone, I'm trying to learn some scripts but i cant get my head around two of them. 1. how can i write a script that will count the number of times a particular word is used in file? 2. how can i make a script that will take me to a web page from unix? if anyone could help it... (3 Replies)
Discussion started by: BigTool4u2
3 Replies

9. Shell Programming and Scripting

Mailing script

Hi, I have a file lets say FILE1. FILE1 ------ name,age charlie,25 harry,29 david,32 Pls help me writing a mailing script.... which will mail the content of file in the body of the mail & it will look something like below in two columns. name age charlie 25 harry 29... (1 Reply)
Discussion started by: 46019
1 Replies

10. Shell Programming and Scripting

Help On Unix Script Count Line Of File

I have to compare the number of files of two files on a Shell Script: I tryied with wc and wiith sed but I can not make an integer... #!/bin/sh . . n = ls -l | wc -l $file1 `echo "Line: "$n". ">>$LOGFILE` xx = sed -n '$=' $file2 `echo "Line: "$xx". ">>$LOGFILE` Aways... (4 Replies)
Discussion started by: fafo77
4 Replies
Login or Register to Ask a Question