Unix Shell - Hi All

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > December 2006 > Hi All





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Hi All
Guru

2006-12-13, 1:37 am

Hi

I have two files one devdata.txt with 260471 records and other
proddata.txt with 260472 records.

how can i see that one record with is different . I want to see that
record to analyze how null handling is done for that records.

I have tried diff,cmp but no help

Early help will be appreciated

Thanks

Chris F.A. Johnson

2006-12-13, 1:37 am

On 2006-12-13, Guru wrote:
> Hi
>
> I have two files one devdata.txt with 260471 records and other
> proddata.txt with 260472 records.
>
> how can i see that one record with is different . I want to see that
> record to analyze how null handling is done for that records.
>
> I have tried diff,cmp but no help


Have you tried comm?

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Guru

2006-12-13, 1:37 am

Yeps

I have tried but didnt get the desired result

Thanks

Chris F.A. Johnson wrote:
> On 2006-12-13, Guru wrote:
>
> Have you tried comm?
>
> --
> Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell>
> Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
> ===== My code in this post, if any, assumes the POSIX locale
> ===== and is released under the GNU General Public Licence


Janis Papanagnou

2006-12-13, 1:37 am

Guru wrote:
> Yeps
>
> I have tried but didnt get the desired result


Try googling for "desired result"...
[vbcol=seagreen]
>
> Thanks
>
> Chris F.A. Johnson wrote:
>

....or make clear what you mean by the above sentence.
[vbcol=seagreen]
Scott McMillan

2006-12-13, 1:19 pm

On Wed, 13 Dec 2006 08:12:25 +0100, Janis Papanagnou
<Janis_Papanagnou@hotmail.com> wrote:

>Guru wrote:
>
>Try googling for "desired result"...
>

Hehe! :-) Thanks Janis, that's starting my day off right!

<snip>


Scott McMillan
Chris F.A. Johnson

2006-12-13, 1:19 pm

On 2006-12-13, Guru wrote:
> Chris F.A. Johnson wrote:

[please don't top post]
[vbcol=seagreen]
> Yeps
>
> I have tried but didnt get the desired result


And what is the desired result?

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Loki Harfagr

2006-12-14, 7:29 pm

Le Tue, 12 Dec 2006 21:56:37 -0800, Guru a écrit_:

> Hi
>
> I have two files one devdata.txt with 260471 records and other
> proddata.txt with 260472 records.
>
> how can i see that one record with is different . I want to see that
> record to analyze how null handling is done for that records.
>
> I have tried diff,cmp but no help
>
> Early help will be appreciated


Though it's not Easter yet here's the answer to your problem !

The "one record wich is different" is the 260472nd one, it's a \x0d

If that's wrong just shuffle the records in one file and
compare them again.

A possibly faster way'd be to pre-sort the files
say # (sort -n proddata.txt) | diff - Thesorteddevdata.txt
Tintin

2006-12-15, 1:34 am


"Guru" <guru1309@gmail.com> wrote in message
news:1165993616.844931.50790@j72g2000cwa.googlegroups.com...
> Chris F.A. Johnson wrote:
>
> I have tried but didnt get the desired result
>


We tried, but you didn't give the desired information.



--
Posted via a free Usenet account from http://www.teranews.com

William James

2006-12-15, 7:33 am

Guru wrote:
> Hi
>
> I have two files one devdata.txt with 260471 records and other
> proddata.txt with 260472 records.
>
> how can i see that one record with is different . I want to see that
> record to analyze how null handling is done for that records.
>
> I have tried diff,cmp but no help
>
> Early help will be appreciated
>
> Thanks


Lines unique to file 1:

ruby -e 'a=gets(nil).to_a;b=gets(nil).to_a;puts a-b' file1 file2

Lines unique to file 2:

ruby -e 'a=gets(nil).to_a;b=gets(nil).to_a;puts b-a' file1 file2

All unique lines:

ruby -e 'a=gets(nil).to_a;b=gets(nil).to_a;puts (a-b)+(b-a)' file1 file2

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com