Sponsored Content
Full Discussion: Match file and find count
Top Forums UNIX for Beginners Questions & Answers Match file and find count Post 303015177 by arunkumar_mca on Thursday 29th of March 2018 02:52:41 PM
Old 03-29-2018
Match file and find count

Hi All,

I have transaction in one file.I want to match that to another file and find the number of time the transaction is available on the other file.I need to take each record from TRANSFILE and match that with SPEND FILE and find the number of counts of the transaction

TRANSFILE:

Code:
1000189376
100500004296
1013558744
1013558748
1013558861
1019100045
1019135000
1025088101


SPEND FILE:
Code:
1450001254;5.79
2114014282;3.18
1013558744;1.89
1013558744;3.29
2114021154;0.60
2114021220;0.73
2114026059;2.69
2114026118;2.29
2114027918;1.69
1019135000;1.06

Output should be like


Code:
1000189376 ----->0
100500004296 ---->0
1013558744 ----->2
1013558748 ----->0
1013558861----->0
1019100045 ----->0
1019135000 ----->1
1025088101----->0


Last edited by arunkumar_mca; 03-29-2018 at 03:54 PM.. Reason: Added text
 

10 More Discussions You Might Find Interesting

1. Linux

To find multiple strings count in a file

I need to find the line count of multiple strings in a particular file. The strings are as follows: bmgcc bmgccftp bsmsftp bulkftp cctuneftp crbtftp crmpos cso gujhr I am doing manual grep for each of the string to find the line count. The command i am using right now is: grep mark... (3 Replies)
Discussion started by: salaathi
3 Replies

2. Shell Programming and Scripting

How to find a count of a word within a file

Hello, I'm looking for a wait to count the number of occurrences of a certain string of characters within a file. The file that I trying to parce has segments within the file that have a header and footer to each segment and I'm trying to do a count of the header string and compare it to a count... (9 Replies)
Discussion started by: bd_joy
9 Replies

3. Shell Programming and Scripting

How to find first match and last match in a file

Hi All, I have a below file: ================== 02:53 pravin-root 02:53 pravin-root 03:05 pravin-root 02:55 pravin1-root 02:59 pravin1-root ================== How do I find the first and last value of column 1. For example, how do I find 02:53 is the first time stamp and 03:05 is... (3 Replies)
Discussion started by: praving5
3 Replies

4. Shell Programming and Scripting

How to find lines that match exact input and count?

I am writing a package manager in BASH and I would like a small snippet of code that finds lines that match exact input and count them. For example, my file contains: xyz xyz-lib2.0+ xyz-lib2.0 xyz-lib1.5 and "grep -c xyz" returns 4. The current function is: # $1 is the package name.... (3 Replies)
Discussion started by: cooprocks123e
3 Replies

5. Shell Programming and Scripting

Count the delimeter from a file and delete the row if delimeter count doesnt match.

I have a file containing about 5 million rows, in the file there are some records which has extra delimiter at random position. (we dont know the positions), now we have to Count the delimeter from each row and if the count of delimeter is not matching then I want to delete those rows from the... (5 Replies)
Discussion started by: Akumar1
5 Replies

6. Shell Programming and Scripting

File count for symlink using find command

Hi Guys, The script which I am using works really good for finding the file count for files that are not symlink. I know I can use find command like: find . -type l | wc -l This way I can get filecount of the symlink but is there a one liner to use -type l and -type f option ? That is... (4 Replies)
Discussion started by: dixits
4 Replies

7. Shell Programming and Scripting

Match look up file and find result

Hi I ahve a lookup file wiht seven words CD HT CAD HT T1D T2D BDanother file contain data like this CHRM1 P11229 Pirenzepine DAP000492 Peptic ulcer disease Approved T2D CHRM1 P11229 Glycopyrrolate DAP001116 Anesthetic Approved T2D CHRM1 P11229 ... (7 Replies)
Discussion started by: manigrover
7 Replies

8. UNIX for Dummies Questions & Answers

How to find count total number of pattern in a file …?

How to find count total number of pattern in a file … File contains : a.txt ------------- aaa bbb nnn ccc aaa bbb aaa ddd aaa aaa aaa aaa grep -c aaa a.txt Op: 4 ( But my requirement is should count the total no of patterns as 7 ) (4 Replies)
Discussion started by: Jitten
4 Replies

9. UNIX for Beginners Questions & Answers

How to count lines of CSV file where 2 fields match variables?

I'm trying to use awk to count the occurrences of two matching fields of a CSV file. For instance, for data that looks like this... Joe,Blue,Yes,No,High Mike,Blue,Yes,Yes,Low Joe,Red,No,No,Low Joe,Red,Yes,Yes,Low I've been trying to use code like this... countvar=`awk ' $2~/$color/... (4 Replies)
Discussion started by: nmoore2843
4 Replies

10. UNIX for Beginners Questions & Answers

How to find the count of IP addresses that belong to different subnets and display the count?

Hi, I have a file with a list of bunch of IP addresses from different VLAN's . I am trying to find the list the number of each vlan occurence in the output Here is how my file looks like 1.1.1.1 1.1.1.2 1.1.1.3 1.1.2.1 1.1.2.2 1.1.3.1 1.1.3.2 1.1.3.3 1.1.3.4 So what I am trying... (2 Replies)
Discussion started by: new2prog
2 Replies
sip_get_trans(3SIP)				   Session Initiation Protocol Library Functions			       sip_get_trans(3SIP)

NAME
sip_get_trans - lookup a transaction SYNOPSIS
cc [ flag ... ] file ... -lsip [ library ... ] #include <sip.h> const struct sip_xaction *sip_get_trans(sip_msg_t sip_msg, int which, int *error); DESCRIPTION
The sip_get_trans() transaction for the SIP message sip_msg. A transaction is not freed if there are any references on it. The transaction type should be specified as one of the following: SIP_CLIENT_TRANSACTON - lookup a client transaction SIP_SERVER_TRANSACTON - lookup a server transaction The sip_get_trans() function matches a transaction to a message as specified in RFC 3261, sections 17.1.3 and 17.2.3. The sip_get_trans() function holds a reference to the returned transaction. The caller must release this reference after use. RETURN VALUES
The sip_get_trans() function returns the required value on success or NULL on failure. The value of errno is not changed by these calls in the event of an error. ERRORS
On success, the value of the location pointed to by error is set to 0. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
libsip(3LIB) SunOS 5.11 25 Jan 2007 sip_get_trans(3SIP)
All times are GMT -4. The time now is 05:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy