LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-28-2007, 01:43 PM   #1
vxc69
Member
 
Registered: Jul 2004
Distribution: Ubuntu
Posts: 370

Rep: Reputation: 31
Smile Looking for a program that shows differences in 2 ascii files


Hello there,


I'm looking for a program that shows differences in two ascii files, particularly differences in source code of two files (i.e. both contain the same code one with the correct code and the other with some mistakes). Can emacs do this? I'm not sure and I'm not too keen on using emacs for some reason.



Thanks,
vxc
 
Old 09-28-2007, 02:09 PM   #2
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian Squeeze, Gentoo
Posts: 1,147
Blog Entries: 1

Rep: Reputation: 48
You would be looking for a command called 'diff'. It's probably already on your computer.
 
Old 09-28-2007, 02:25 PM   #3
vxc69
Member
 
Registered: Jul 2004
Distribution: Ubuntu
Posts: 370

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by PatrickNew View Post
You would be looking for a command called 'diff'. It's probably already on your computer.
I've used diff before, if I recall correctly it was while patching some code some time back, I was just following instructions and didn't really bother finding out what diff actually did.

diff will work fine, thanks Patrick!

Last edited by vxc69; 09-28-2007 at 02:26 PM.
 
Old 09-28-2007, 03:29 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 3,666

Rep: Reputation: 204Reputation: 204Reputation: 204
If you would, instead, prefer a GUI, look at kdiff3. (A KDE application.)
 
Old 09-28-2007, 06:37 PM   #5
vxc69
Member
 
Registered: Jul 2004
Distribution: Ubuntu
Posts: 370

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by PTrenholme View Post
If you would, instead, prefer a GUI, look at kdiff3. (A KDE application.)
I got tkdiff instead. Don't really use KDE anymore so don't want to install all the dependecies just for kdiff.

Thanks
 
Old 09-29-2007, 02:19 AM   #6
fcdev
Member
 
Registered: Sep 2005
Posts: 46

Rep: Reputation: 15
If it's any help, there's a very good source-compare tool for Windows called Beyond Compare. I used it before in my previous job to manage source code submissions from multiple programmers. I haven't looked into kdiff3, tkdiff, or diff ... but since I now need a source compare tool for Linux, I will.
 
Old 09-29-2007, 08:07 AM   #7
vxc69
Member
 
Registered: Jul 2004
Distribution: Ubuntu
Posts: 370

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by fcdev View Post
If it's any help, there's a very good source-compare tool for Windows called Beyond Compare. I used it before in my previous job to manage source code submissions from multiple programmers. I haven't looked into kdiff3, tkdiff, or diff ... but since I now need a source compare tool for Linux, I will.
You gotta buy that though, low on cash right now. Thanks for the info anyways, might come in handy one day.
 
Old 10-01-2007, 12:34 PM   #8
sunils1973
Member
 
Registered: Jan 2007
Posts: 302

Rep: Reputation: 30
What u required is the "comm" command

It compares the files and produces output in three columns
1) Lines unique to first file only
2) Lines unique to second file only
3) Lines common to both files

we can suppress each columns by applying -1,-2 and -3
 
  


Reply

Tags
diff


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
grep ASCII files only zchoyt Linux - General 2 05-16-2006 03:55 AM
Linux/UNIX differences with vi and ftp ascii transfers KenMadsen Linux - Newbie 2 06-20-2005 09:51 AM
Transferring 40000+ files with FTP (mget) shows 0 files tim1235 Linux - Software 5 10-17-2004 06:06 PM
ASCII Art Program mattp Programming 2 03-15-2004 10:32 PM
Mail program differences dwpondscum Linux - Networking 2 05-07-2003 04:10 PM


All times are GMT -5. The time now is 08:54 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration