Jimerson
11-11-2007, 03:26 AM
I frequently have to work with text files at my office, and do comparisions on files to see what is in both files, and what is in one, but not the other.
The files are not always in the same layout, and in some cases it would be very hard to make them that way, allthough the same information is in both files.
I normally end up having to look through thousands of lines of text and do these comparisions by hand. What language do you guys reccomend trying this in?
Thanks for your input.
~Jim:confused:
dmspilot
11-11-2007, 03:50 AM
Perl, it is a text manipulation language that was designed for things like this.
debiannerd
11-11-2007, 11:16 AM
Perl, it is a text manipulation language that was designed for things like this.
bash scripting is faster ;-) ... there are already linux command that do that...
Jimerson
11-11-2007, 01:58 PM
I have worked with Java and PHP, would bash or pearl be easier to learn for me?
Burhan
11-11-2007, 02:14 PM
To use bash, you would ideally be on a linux or unix system.
Perl has its own learning curve (like any other language). If you just need to do comparisons between files, then perhaps something simpler like a visual diff program might be what you need.
You didn't specify what operating system you are on, so I will give you two examples of diff programs:
CSDiff (http://www.componentsoftware.com/Products/CSDiff/index.htm) for Windows
meld (http://meld.sourceforge.net/) for unix.
You really don't need to learn a new programming language if you just want to compare files :)
Jimerson
11-11-2007, 02:54 PM
Appreciate the input. Meld looks very nice. I have linux and windows at my disposal, so it really doesn't matter to me, whatever does the job better.
Thanks Again,
~Jim
mrbenny
11-20-2007, 03:20 AM
You can also try looking into Python. =)
holmesa
11-27-2007, 06:39 PM
May be just find an existing utility that compares files?
There are standard utilities that run from the command file, like fc. But they are not very usable. Or you can get a better graphical utility that supports navigation through text files, marking differences, new lines, deleted text etc.
Adam-AEC
11-27-2007, 06:51 PM
For windows I used to use a program called BeyondCompare. It worked great, had a nice two-pane layout, and was reasonably priced (~30$ or so)
holmesa
11-27-2007, 07:14 PM
do you plan to create a software by your own with a smaller budget? ;)
I have to second PERL and or BASH. Personally I use PERL for everything, even when i want BASH like functionality.