![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| shell script for comparing 2 files | prashanth.spl | UNIX for Dummies Questions & Answers | 2 | 06-20-2008 10:09 AM |
| comparing PID values of 2 Files in shell Options | marconi | Shell Programming and Scripting | 2 | 12-19-2007 01:02 PM |
| How to Read config (.cfg) files using shell scripting | smallwonder | UNIX for Advanced & Expert Users | 5 | 03-02-2007 12:37 AM |
| rename files using shell scripting | gfhgfnhhn | Shell Programming and Scripting | 4 | 07-04-2006 04:37 PM |
| shell script comparing files in a file | raina_nalin | Shell Programming and Scripting | 4 | 06-21-2005 06:00 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Comparing two .txt files in shell scripting...
Hi,
I have two big .txt files.and i need to compare those two files and redirect it into some other file. If any body wants to resolve this issue then i can send the two text files. Need some quick responce. Thanks, prakash |
|
||||
|
Hi,Thanks for the quick reply.In those two commands we can have the difference.But my files are very big in size and i need the comparison which will show only the difference part.for example:Test1-Hi i am prakashTest2-Hi i amThen the required shell script should show the diffrence as praksh.But the diff command will show both the files and comparison.as my files are very big the redirected file is even bigger.There fore i need a generalized shell script which will workwaiting for the response.ThanksPrakash
|
|
||||
|
FileKruncher
There are so many ways to skin this cat, but my favorite is the stl. If you use two custom streams, and tweak your buffers to the rightt size, you can do just about any kind of file comparison you can imagine, and get pretty good speed out of it.
I have a sample if you're interested. Here's an example of the streams (not completely tested). WebKruncher.com/speedstreams.h - It's used like any typical file streams, just create and call getline 'till eof or read in chunks for a binary comparisons. -Jmt |
![]() |
| Bookmarks |
| Tags |
| linux, solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|