Sponsored Content
Top Forums Shell Programming and Scripting I want a count only when couple of value exist in each line of my source. Post 302479412 by elamurugu on Friday 10th of December 2010 02:48:10 PM
Old 12-10-2010
I want a count only when couple of value exist in each line of my source.

I have to get the count only if poc=4060 and loc=JPN ( basically I want to check both values exist then count the occurrences.)


disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=& drc=&mo=&sid=&lang=EN&loc=JPN

I have been trying like this
grep -c -E 'oc=70|pc=64150' samplelogs.log

tr -cs 'A-Za-z0-9=' '\n' < samplelogs.log | grep -c -E 'oc=70|pc=64150|rc=1'
but not seems to workout perfectly.

Help me on this..
Thanks
EM
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Source and Target count checking

Hi My source database is seibel and the target is oracle. I need to check the count for source query and target query. if it is equal then i need to send and success mail to an email id. If it is not equal need to send an failure mail to an email id. pl let me know about the script in ksh. ... (2 Replies)
Discussion started by: ksmbabu
2 Replies

2. Shell Programming and Scripting

Count total unique destination for source

Hi, need help how to count unique destination for the source ip. The file is contains 4 number of fields. Example of the file is here src ip dest ip #of flows total bytes 192.168.6.0 88.0.33.2 12 128 192.168.6.0 88.0.33.2 1 168 192.168.6.0 ... (5 Replies)
Discussion started by: new_buddy
5 Replies

3. Shell Programming and Scripting

Count uncommented, blank and source lines in perl

Hi friends, I am working on a perl script to count the commented lines, blank lines and source lines separately. Let me know if you have one. For example i have a file containing the lines: /** * SOURCE CODE */ public class SessionConstants { /** * Code for Session created */... (4 Replies)
Discussion started by: nmattam
4 Replies

4. UNIX for Dummies Questions & Answers

how to count number of times each word exist in a file

I'm trying to count the number of times each word in the file exist for example if the file has: today I have a lot to write, but I will not go for it. The main thing is that today I am looking for a way to get each word in this file with a word count after it specifying that this word has... (4 Replies)
Discussion started by: shnkool
4 Replies

5. UNIX for Dummies Questions & Answers

Mapping a data in a file and delete line in source file if data does not exist.

Hi Guys, Please help me with my problem here: I have a source file: 1212 23232 343434 ASAS1 4 3212 23232 343434 ASAS2 4 3234 23232 343434 QWQW1 4 1134 23232 343434 QWQW2 4 3212 23232 343434 QWQW3 4 and a mapping... (4 Replies)
Discussion started by: kokoro
4 Replies

6. UNIX for Dummies Questions & Answers

Help! Need "File exist check" and line count

Hello, I've been stuck with this for a few days now :wall:, so I'm hoping someone out there might be kind enough to help me. I need to do a "file exist" check with a variable in the file name. After that I need to do a line count on the file, and output its results to a txt file. For... (3 Replies)
Discussion started by: ronan1219
3 Replies

7. 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

8. 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

9. Shell Programming and Scripting

Count the number of files copied from source to destination location

Hi Guys, how to count number of files successfully copied while coping files from source to destination path ex:10 files from source to target location copying if 8 files copied successfully then echo successfully copied=8 failure=2 files if two files get error to coping files from... (23 Replies)
Discussion started by: sravanreddy
23 Replies

10. 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
ISALNUM_L(3)						   BSD Library Functions Manual 					      ISALNUM_L(3)

NAME
isalnum_l, isalpha_l, isblank_l, iscntrl_l, isdigit_l, isgraph_l, ishexnumber_l, isideogram_l, islower_l, isnumber_l, isphonogram_l, isprint_l, ispunct_l, isrune_l, isspace_l, isspecial_l, isupper_l, isxdigit_l -- character classification utilities LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <wctype.h> #include <xlocale.h> int isalnum_l(int c, locale_t loc); int isalpha_l(int c, locale_t loc); int isblank_l(int c, locale_t loc); int iscntrl_l(int c, locale_t loc); int isdigit_l(int c, locale_t loc); int isgraph_l(int c, locale_t loc); int ishexnumber_l(int c, locale_t loc); int isideogram_l(int c, locale_t loc); int islower_l(int c, locale_t loc); int isnumber_l(int c, locale_t loc); int isphonogram_l(int c, locale_t loc); int isprint_l(int c, locale_t loc); int ispunct_l(int c, locale_t loc); int isrune_l(int c, locale_t loc); int isspace_l(int c, locale_t loc); int isspecial_l(int c, locale_t loc); int isupper_l(int c, locale_t loc); int isxdigit_l(int c, locale_t loc); DESCRIPTION
These functions are extended locale versions of the corresponding functions, with the _l removed. Also, see xlocale(3) for more information about extended locales. SEE ALSO
isalnum(3), isalpha(3), isblank(3), iscntrl(3), isdigit(3), isgraph(3), ishexnumber(3), isideogram(3), islower(3), isnumber(3), isphonogram(3), isprint(3), ispunct(3), isrune(3), isspace(3), isspecial(3), isupper(3), isxdigit(3), xlocale(3) BSD
March 11, 2005 BSD
All times are GMT -4. The time now is 04:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy