The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find duplicates from multuple files with 2 diff types of files ricky007 Shell Programming and Scripting 2 03-04-2008 01:46 PM
Compare/Diff between directories and subdirectories? andylee80 UNIX for Dummies Questions & Answers 5 07-12-2007 09:45 AM
script to compare files pulse2india Shell Programming and Scripting 0 10-19-2005 04:32 PM
perl package directories - what if the script is diff DIR to the one contain *.pm? gusla Shell Programming and Scripting 1 11-23-2004 08:32 PM
diff 2 files; output diff's to 3rd file blt123 Shell Programming and Scripting 2 05-28-2002 11:29 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-29-2008
vasuki vasuki is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 1
compare 2 coloum of 2 diff files using perl script

Hi,

i am new to perl scripting.. i am still learing it.. i am asked to write a perl script which should compare 2 coloums of 2 different files. if those 2 coloumn are same the script should store the both the lines in 2 diff files.

these are files,

file 1:
21767016 226112 char[]
19136520 797355 java.lang.String
17769368 307049 java.lang.Object[]
13981656 582569 java.util.HashMap$Entry
10867240 16650 int[]
9065616 559799 java.lang.String[]
9060192 79626 java.util.HashMap$Entry[]
6969384 23146 byte[]
6857664 285736 java.util.Vector


file 2:
21702192 904258 java.lang.String
20985320 360561 java.lang.Object[]
20524112 209810 char[]
12623280 525970 java.util.HashMap$Entry
10945080 678896 java.lang.String[]
9781432 10871 int[]
8302464 345936 java.util.Vector
8107104 337796 netscape.ldap.util.RDN
7620024 68357 java.util.HashMap$Entry[]
6515152 52272 * ConstMethodKlass

so i have to compare 3rd coloumn of these to 2 files, eg i have java.lang.string present in both so i want the script store these complete line of both the files in 2 diff files. These 2 files are big files.

please suggest me how can this be done. some one had suggested you can use the hash table implementation.

thanks,
Vasuki
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0