Re: diff

From: Bobak, Mark <Mark.Bobak_at_proquest.com>
Date: Mon, 21 Dec 2009 10:46:42 -0500
Message-ID: <2DBF9A18-4071-40B7-AB85-65FD7F6B0E84_at_proquest.com>



Hi David,

The definition of what's acceptable can be found at: http://www.freelists.org/list/oracle-l

I see your point, and certainly I made a judgement call. There is probably no right answer. However, based on the fact that the original posting made no mention of Oracle, added to the fact that this particular poster seems to like being spoonfed answers, I took the position I did.

-Mark

Sent from my iPhone

On Dec 21, 2009, at 9:33, "David Pintor" <painterman_at_gmail.com<mailto:painterman_at_gmail.com>> wrote:

Where are exactly the limits on what is off-topic and what it isn't?

Even if this is an Oracle list and I agree that we should talk about Oracle here, I think the subject might be of interest to most DBA's, specially those working on Unix servers. It's not like if the question was about how to bake a cake or something.

Also, I presume you will agree that any good DBA *must* have good OS skills, which makes me think that this question is not completely unrelated.

Unfortunately, I don't know either the solution for Noor's question, so if anyone can help I would be glad to know the answer :-)

Thanks!

David

2009/12/21 Bobak, Mark <<mailto:Mark.Bobak_at_proquest.com>Mark.Bobak_at_proquest.com<mailto:Mark.Bobak_at_proquest.com>> There seems to be a failure to communicate here. This list is 'Oracle-L'. I don't see any Oracle related questions. Just because there are many people on this list that happen to have knowledge on large variety of subjects, that's not a license to post questions on any subject that strikes your fancy.

Please restrict your questions to Oracle related subjects.

-Mark

Sent from my iPhone

On Dec 21, 2009, at 6:38, "Noor Mulla" <<mailto:Noor.Mulla_at_hcl.in>Noor.Mulla_at_hcl.in<mailto:Noor.Mulla_at_hcl.in>> wrote:

Hi,

I have couple of files (one like below as exmple) which needs to be compared using diff command.

File a.txt

Table_name     row_count
A                             10
D                             11
C                             34
D                             45
E                              34
F                              26
G                             83

File b.txt
Table_name     row_count
A                             10
D                             11
C                             34
C1                           67
C2                           87
D                             45
E                              34
E1                           19
E2                           90
F                              26
G                             83

However, if the contents in both the files are not in sequence(side by side) its not giving the correct output.

I am using this command - diff a.txt b.txt |awk '{ if($2 != $4) print }'| awk '{printf "%s %s\n",$1, $4}'> result.out

How can I get the results irrespective of data not sorted or is there a way that both files can be sorted for order and ignore space/tab etc.

Finally, I want to send the result to my manager via mailx ….

Eg:
DBALIST=’<mailto:asdf_at_test.in>asdf_at_test.in<mailto:asdf_at_test.in>’ SUBJECT="WARNING: Row count difference in Oracle Sybase"

diff c.txt d.txt |awk '{ if($2 != $4) print  }' > result1.out
diff e.txt f.txt |awk '{ if($2 != $4) print  }' > result2.out
diff g.txt h.txt |awk '{ if($2 != $4) print  }' > result3.out
mailx -s "$SUBJECT" $DBALIST < output.txt

How can I club all 3 result* file into one. If I open output.txt file I should be able to identify result1.out,result2.out etc… Thanks & Regards
Noor M Mulla
HCLT - Bangalore

DISCLAIMER:


The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect.


--

http://www.freelists.org/webpage/oracle-l Received on Mon Dec 21 2009 - 09:46:42 CST

Original text of this message