The UNIX and Linux Forums  

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
comparing scalars contaning "DOUBLE QUOTES" as data rssrik Shell Programming and Scripting 5 04-20-2008 10:25 AM
Comparing data in file with values in table Mohit623 Shell Programming and Scripting 0 01-22-2008 08:57 AM
Problem comparing 2 files with lot of data rafisha Shell Programming and Scripting 4 07-25-2007 08:56 PM
How to search a pattern inside a zipped file ie (.gz file) with out unzipping it senraj01 Shell Programming and Scripting 2 04-26-2006 05:32 AM
Comparing data list... giannicello UNIX for Dummies Questions & Answers 4 03-06-2003 01:08 PM

 
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 06-18-2008
email-lalit email-lalit is offline
Registered User
  
 

Join Date: May 2008
Posts: 36
Comparing data inside file

Hi Everyone,

I will try to explain my question please forgive my english here.

I am looking for shell script or command that can compare data in the files.

I have 50 files in one directory test1 test2 test3 ....so on.

I want to compare data in each files with each other and output each line with same data in one file.

so each file contain extactly same data but the bytes are different

so for example of three files data:

data in test1:


Code:
-ommuniGate,1,7659,96
-me/abhiram,1,7615,96
-me/ahonnik,1,7610,96
-home/aleda,0,134307,67936
-/home/apps,1,323610,79168
-me/archive,1,7611,96
-/home/atmf,0,7613,96
-/home/baja,1,8431,352
-ome/bbcron,0,7639,96
-home/bbjen,0,8129,224
-/home/bcdf,0,7810,128
-/home/beth,0,7670,96
-/home/bing,1,206505,55232
-home/blinn,0,1167752,412608
-e/bmandell,0,7683,96
-0/home/bob,1,7631,96
-home/bobby,1,31936,11680
-ome/cadams,0,48664,28224
-me/cbaxter,1,7615,96
-me/cjensen,0,7642,96
-ome/cklang,1,7615,96
-me/ckohler,1,7682,128
-e/cmargozz,0,35436,17888
-e/cpitcher,1,7615,96
-e/cschroff,0,8571,352
-ome/cyoung,1,7615,96
-ome/daniel,0,171547,53024

data in test2:

Code:
-ommuniGate,1,7717,96
-me/abhiram,1,7615,96
-me/ahonnik,1,7610,96
-home/aleda,1,7611,96
-/home/apps,1,323653,79168
-me/archive,1,115224,106912
-/home/atmf,1,7611,96
-/home/baja,1,8634,384
-ome/bbcron,1,7611,96
-home/bbjen,1,7611,96
-/home/bcdf,1,7611,96
-/home/beth,1,7615,96
-/home/bing,1,207685,55360
-home/blinn,1,7620,96
-e/bmandell,1,7611,96
-0/home/bob,1,7631,96
-home/bobby,1,31936,11680
-ome/cadams,1,7611,96
-me/cbaxter,1,7615,96
-me/cjensen,1,7611,96
-ome/cklang,1,7615,96
-me/ckohler,1,7682,128
-e/cmargozz,1,7611,96
-e/cpitcher,1,7615,96
-e/cschroff,1,7611,96
-ome/cyoung,1,7615,96
-ome/daniel,1,7622,96

data in test 3:


Code:
-ommuniGate,1,261840,134880
-me/abhiram,1,7615,96
-me/ahonnik,1,7610,96
-home/aleda,1,7611,96
-/home/apps,1,328804,80384
-me/archive,1,115224,106912
-/home/atmf,1,7611,96
-/home/baja,1,25709,9888
-ome/bbcron,1,7611,96
-home/bbjen,1,7611,96
-/home/bcdf,1,7611,96
-/home/beth,1,7615,96
-/home/bing,1,217811,58944
-home/blinn,1,7620,96
-e/bmandell,1,7611,96
-0/home/bob,1,101510,17120
-home/bobby,1,67032,28544
-ome/cadams,1,7611,96
-me/cbaxter,1,7615,96
-me/cjensen,1,7611,96
-ome/cklang,1,7615,96
-me/ckohler,1,7731,128
-e/cmargozz,1,7611,96
-e/cpitcher,1,7615,96
-e/cschroff,1,7611,96
-ome/cyoung,1,8880,576
-ome/daniel,1,7622,96


I am looking for out put like this:


Code:
-ommuniGate,1,7659,96
-ommuniGate,1,7717,96
-ommuniGate,1,261840,134880

-me/abhiram,1,7615,96
-me/abhiram,1,7615,96
-me/abhiram,1,7615,96

-me/ahonnik,1,7610,96
-me/ahonnik,1,7610,96
-me/ahonnik,1,7610,96

so on so for.....

How i can do this can someone help me please.

thanks,
-lalit
 

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 05:50 AM.


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