Sponsored Content
Top Forums Shell Programming and Scripting Find common entries in 2 list and write data before it Post 302681271 by elixir_sinari on Friday 3rd of August 2012 05:20:07 AM
Old 08-03-2012
I think this is one of the most common types of problems posted. You should have searched well.
Code:
awk 'FNR==NR{a[$1]=$2;next}$NF in a{$0=$0 FS a[$NF]}1' file1 file2

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to parse a list of data to find the missin stats.

HI ALL, Thanks for helping me with my last post. :b: I have one more doubt, i want to parse a set of data. which is consisting of some values that occured in particular period of time. And when i parse down if there is a missing time period then it should show the two rows between which the... (3 Replies)
Discussion started by: asirohi
3 Replies

2. Homework & Coursework Questions

Shell script calling Perl function, sort and find data, write to new files

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I must write a shell script that calls two external Perl functions--one of which sorts the data in a file, and... (6 Replies)
Discussion started by: kowit010
6 Replies

3. Shell Programming and Scripting

find common data

Hey guys, I have two files. file1 and file2. file1: a,1 b,2 c,343 d,343 e,4343 f,4544 file 2: a, d, e, Now i need to find the common data between these files from file1. i.e a,1 (8 Replies)
Discussion started by: jaituteja
8 Replies

4. Shell Programming and Scripting

Request to check:find out common entries

I have to compare 2 files which means 2 files with common entries in same column and separate those common entries in a diferent file as well right before those entries common so that I can separat common and Uncommon entries in rows in 2 different files. Is it possible For eg. one file ... (3 Replies)
Discussion started by: manigrover
3 Replies

5. Shell Programming and Scripting

Request to check: find common and write before it

Hi all, I have 2 big files with such kind of inputs File I File II I want the output file shuld contain Please let me knw scripting regarind this (1 Reply)
Discussion started by: manigrover
1 Replies

6. Shell Programming and Scripting

Request to check: compare two files , match same entries, write data before it

Hi all, I have 2 files:Column1 of first file has to be matched with column 3 of second file first file contain DATA like this in 2 columns one with gene name second with whether CAD,HT,RA T2Dor any one column 1 column2 ARFGEF2 CAD DDEF2 CAD PSCD3 CAD PSCD4 CAD CAMK1... (5 Replies)
Discussion started by: manigrover
5 Replies

7. Shell Programming and Scripting

Find common entries

Hi all I have to compare two files and find common entries First file is like this XVY CVY ZYN MNA In second file I have to search these entries in even number of columns 5 XVY 7 hdfj 8 CVY 9 if there is common entries then out put shuld be 5 XVY(approved) 7 hdfj 8... (11 Replies)
Discussion started by: manigrover
11 Replies

8. Shell Programming and Scripting

Find matches and write the data before it

Hi all I am here for help once again I have two files One file is like this with one columns F2 B2 CAD KGM HTC CSP Second file is like this in 5 columns where firs column contain sometime entries of first file with space and other entries (12 Replies)
Discussion started by: Priyanka Chopra
12 Replies

9. Shell Programming and Scripting

Find Data in test file and write each out to a line

I have a .csv file that has been create from a google form and I need to extract the data from it that has been entered by users. The CSV will have anywhere between 100 and 1000 lines which comprise entr data for a sports carnival A few typical line is shown here to show the problem I have ... (19 Replies)
Discussion started by: kcpoole
19 Replies

10. Shell Programming and Scripting

Find common values in python list in ordered format

Hello All, There are various codes available to find the intersection between two sets in python. But my case is the following: I want to find the continual common pattern in different lists compared to list1. (i have underlined the longest common patterns in set a and set b) a = 2, 3, 5,... (1 Reply)
Discussion started by: Zam_1234
1 Replies
LedgerSMB::DBObject::Reconciliation(3pm)		User Contributed Perl Documentation		  LedgerSMB::DBObject::Reconciliation(3pm)

NAME
LedgerSMB::DBObject::Reconciliation - LedgerSMB class defining the core database interaction logic for Reconciliation. SYOPSIS
This module creates object instances based on LedgerSMB's in-database ORM. METHODS
Please note, this module needs a lot of cleanup. new ($class, base => $LedgerSMB::hash) This is the base constructor for all child classes. It must be used with base argument because this is necessary for database connectivity and the like. Of course the base object can be any object that inherits LedgerSMB, so you can use any subclass of that. The per-session dbh is passed between the objects this way as is any information that is needed. get_report($self, $report_id) Collects all the rows from the database in the given report. Returns an arrayref of entries in the table for the given report_id. Returns undef in the event of no records found. get_corrections($self, $report_id, $entry_id) Returns the corrections made for the selected report and entry. Returns undef in the event of no corrections found. entry ($self,$report_id,$entry_id) Returns a single entry from the pending reports table, either cleared or uncleared. update Updates the report, pulling in any new transactions in the date range into the transaction list. submit Submits the reconciliation set for approval. save Saves the reconciliation set for later work import_file Calls the file import function. This is generally assumed to be a csv file although the plugin is very modular and plugins could be written for other formats. The format structure is per account id. approve($self,$reportid) Approves the pending report $reportid. Checks for error codes in the pending report, and approves the report if none are found. Limitations: The creating user may not approve the report. Returns 1 on success. new_report Creates a new report with data entered. delete ($self, $report_id) Requires report_id This will allow the deletion of a report if the report is not approved and the user either owns the unsubmitted report, or the user has the right to approve reports. Returns 0 if successful, or a true result if not. add_entries Adds entries from the import file routine. This function is extremely order dependent. Meaningful scn's must be submitted first it is also recommended that amounts be ordered where scn's are not found. search Searches for reconciliation reports. No inputs mandatory. date_from and date_to specify ranges. balance_from and balance_to specify ranges chart_id specifies an account submitted and approved are exact matches to status. get Gets all information relating to a reconciliation report. id must be set. Populates main hash with values from cr_report Also populates report_lines a list of report lines account_info a hashrefo of information from the account table. beginning_balance cleared_total outstanding_total mismatch_our_total mismatch_our_credits mismatch_our_debits mismatch_their_total mismatch_their_credits mismatch_their_debits get_accounts This is a simple wrapper around reconciliation__account_list Copyright (C) 2007, The LedgerSMB core team. This file is licensed under the Gnu General Public License version 2, or at your option any later version. A copy of the license should have been included with your software. perl v5.14.2 2011-09-20 LedgerSMB::DBObject::Reconciliation(3pm)
All times are GMT -4. The time now is 02:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy