Sponsored Content
Top Forums UNIX for Advanced & Expert Users Find common Strings in two large files Post 302481965 by kanthrajgowda on Monday 20th of December 2010 09:40:40 AM
Old 12-20-2010
Find common Strings in two large files

Hi ,
I have a text file in the format

DB2: [NodeID=1]
DB2: [NodeID=2]
WB: [NodeID=3]
WB: [NodeID=3]
WB: [NodeID=3]
WB: [NodeID=3]

and a second text file of the format

Time=00:00:00.473 [NodeID=3]
Time=00:00:00.436 [NodeID=3]
Time=00:00:00.016 [NodeID=2]
Time=00:00:00.027 [NodeID=1]
Time=00:00:00.471 [NodeID=3]
Time=00:00:00.436 [NodeID=3]

the last string in both the text files is of the form NodeID=*

I want to combine lines in both the files where the last string in both the files matches ....
something like

DB2: [NodeID=1] Time=00:00:00.027 [NodeID=1]

could you please suggest...

NOTE: the actual size of the text files runs into GBs...

Thanks in advnce.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Files common in two sets ??? How to find ??

Suppose we have 2 set of files set 1 set 2 ------ ------ abc hgb def ppp mgh vvv nmk sdf hgb ... (1 Reply)
Discussion started by: skyineyes
1 Replies

2. UNIX for Dummies Questions & Answers

how to find common words and take them out from two files

Hi, everyone, Let's say, we have xxx.txt A 1 2 3 4 5 C 1 2 3 4 5 E 1 2 3 4 5 yyy.txt A 1 2 3 4 5 B 1 2 3 4 5 C 1 2 3 4 5 D 1 2 3 4 5 E 1 2 3 4 5 First I match the first column I find intersection (A,C, E), then I want to take those lines with ACE out from yyy.txt, like A 1... (11 Replies)
Discussion started by: kaixinsjtu
11 Replies

3. Shell Programming and Scripting

Drop common lines at head/tail of a large set of files

Hi! I have a large set of pairs of text files (each pair in their own subdirectory) and each pair shares head/tail (a couple of first and last lines) but differs in the middle part. I need to delete the heads/tails and keep only the middle portions in which they differ. The lengths of heads/tails... (1 Reply)
Discussion started by: dobryden
1 Replies

4. Shell Programming and Scripting

Find and analyze variable Strings in a large file.

Hi guys, I have multiple files (>5000) which I have in a folder. I read every file name and put it in a tmp variable "i" so that i can use it in the following task. I have a large .txt file (>50 MB) in which I want to find the variable "i" and the lines after this variable, so that I can use... (4 Replies)
Discussion started by: Ashitaka007
4 Replies

5. Shell Programming and Scripting

Simple script to find common strings in two files

Hi , I want to write a simple script. I have two files file1: BCSpeciality Backend CB CBAPQualDisp CBCimsVFTRCK CBDSNQualDisp CBDefault CBDisney CBFaxMCGen CBMCGeneral CBMCQualDisp file2: CSpeciality Backend (8 Replies)
Discussion started by: ramky79
8 Replies

6. Shell Programming and Scripting

Script to find NOT common strings in two files

Hi all, I'd like you to help or give any advise about the following: I have two (2) files, file1 and file2, both files have information common to each other. The contents of file1 is a subset of the contents of file2: file1: errormsgadmin esdp esgservices esignipa iprice ipvpn irm... (0 Replies)
Discussion started by: hnux
0 Replies

7. Shell Programming and Scripting

Script to find NOT common strings in two files

Hi all, I'd like you to help or give any advise about the following: I have two (2) files, file1 and file2, both files have information common to each other. The contents of file1 is a subset of the contents of file2: file1: errormsgadmin esdp esgservices esignipa iprice ipvpn irm... (18 Replies)
Discussion started by: hnux
18 Replies

8. Shell Programming and Scripting

Find Common Values Across Two Files

Hi All, I have two files like below: File1 MYFILE_28012012_1112.txt|4 MYFILE_28012012_1113.txt|51 MYFILE_28012012_1114.txt|57 MYFILE_28012012_1115.txt|57 MYFILE_28012012_1116.txt|57 MYFILE_28012012_1117.txt|57 File2 MYFILE_28012012_1110.txt|57 MYFILE_28012012_1111.txt|57... (2 Replies)
Discussion started by: angshuman
2 Replies

9. UNIX for Dummies Questions & Answers

Find common numbers from two very large files using awk or the like

I've got two files that each contain a 16-digit number in positions 1-16. The first file has 63,120 entries all sorted numerically. The second file has 142,479 entries, also sorted numerically. I want to read through each file and output the entries that appear in both. So far I've had no... (13 Replies)
Discussion started by: Scottie1954
13 Replies

10. Shell Programming and Scripting

Find common files between two directories

I have two directories Dir 1 /home/sid/release1 Dir 2 /home/sid/release2 I want to find the common files between the two directories Dir 1 files /home/sid/release1>ls -lrt total 16 -rw-r--r-- 1 sid cool 0 Jun 19 12:53 File123 -rw-r--r-- 1 sid cool 0 Jun 19 12:53... (5 Replies)
Discussion started by: sidnow
5 Replies
DateTime::Format::DB2(3pm)				User Contributed Perl Documentation				DateTime::Format::DB2(3pm)

NAME
DateTime::Format::DB2 - Parse and format DB2 dates and times SYNOPSIS
use DateTime::Format::DB2; my $dt = DateTime::Format::DB2->parse_timestamp( '2003-01-16-23.12.01.300000' ); # 2003-01-16-23.12.01.300000 DateTime::Format::DB2->format_timestamp($dt); DESCRIPTION
This module understands the formats used by DB2 for its DATE, TIME, and TIMESTAMP data types. It can be used to parse these formats in order to create DateTime objects, and it can take a DateTime object and produce a string representing it in the DB2 format. METHODS
This class offers the following methods. All of the parsing methods set the returned DateTime object's time zone to the floating time zone, because DB2 does not provide time zone information. * parse_time($string) * parse_date($string) * parse_timestamp($string) Given a value of the appropriate type, this method will return a new "DateTime" object. The time zone for this object will always be the floating time zone, because by DB2 stores the local datetime, not UTC. If given an improperly formatted string, this method may die. * format_date($datetime) * format_time($datetime) * format_timestamp($datetime) Given a "DateTime" object, this methods returns an appropriately formatted string. SUPPORT
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details. AUTHOR
Jess Robinson <castaway@desert-island.demon.co.uk> This module was shamelessly cloned from Dave Rolsky's DateTime::Format::MySQL module. COPYRIGHT
Copyright (c) 2005 Jess Robinson. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
datetime@perl.org mailing list http://datetime.perl.org/ perl v5.8.8 2007-01-20 DateTime::Format::DB2(3pm)
All times are GMT -4. The time now is 08:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy