Advertisement

07.08.2008 at 01:42AM PDT, ID: 23545826
[x]
Attachment Details

Reading a file and making SQL joins

Asked by naveenraj in Perl Programming Language

Tags: PERL, PERL

Hi, I have 2 files as below

File1
id:segment:region
GB1:TEST:GB
GB2:TEST:EU
GB3:ABX:AU

File2
id:segment:region
GB1:ABX:AU
GB2:TEST:EU
GB3:ABX:AU

I want to compare these 2 files and return the ids(the whole recor) where there is a change in segments.
Initially i had a solution for that by importing to 2 tables and making a join on both the tables as below.

Select tb1.* from tb1,tb2
inner join tb1.id=tb2.id
where tb1.segment<>tb2.segment

Unfortunately the server I am using dont have MSSQL installed and I cant do a dtsrun utility and hence thought of using a perl script to compare these 2 files to get the desired output. Could pls help me how i can do this.

Regards
Naveen.

Start Free Trial
[+][-]07.08.2008 at 02:11AM PDT, ID: 21952082

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 02:57AM PDT, ID: 21952258

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 10:39AM PDT, ID: 21956142

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 11:25AM PDT, ID: 21956568

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 01:24AM PDT, ID: 21961471

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 08:26AM PDT, ID: 21964715

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: PERL, PERL
Sign Up Now!
Solution Provided By: Adam314
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628