![]() |
|
#1
|
||||
|
||||
Compare a line of textOne of the most boring tasks updating this forum script is when I have to go through the many lines of text in a template to see what, if anything, is different. The (vbulletin) script itself does this pretty well, where it can highlight each line of markup that is new, changed or missing.
But changes within a single line of text is not really handled at all. So if I have previously edited this particular line in a template with multiple additions, modifications and/or deletions, then I can't easily tell them (the modifications) apart. For example, let us say that I have 2 different versions of a line within a template: OLD Code:
NEW Code:
Remember, I'm not comparing whole blocks of text here, just a single line! Ideally, I want something that will highlight the differences between the two. I would expect the script or software to highlight the differences like this: OLD Code:
NEW Code:
Is there something (software) out there already able to do this? I mean, something free of course |
||||
|
#2
|
||||
|
||||
Re: Compare a line of textActually, I'd rather prefer the pseudo code only.
I really don't feel like installing anything on my computer that I will need only very rarely. So I am going to go ahead and try writing something right now... |
|
#3
|
||||
|
||||
Re: Compare a line of textNot sure if you might have it installed, but vimdiff will highlight line differences.
I'm not sure if there is an option to only mark the two words, as you've indicated, but I'm checking... at the prompt: vimdiff f1 f2 EDIT: vimdiff can handle three files. I did a minor f1 f2 f3 for a simple test. Thought this might be helpful to know. (or not) __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#4
|
||||
|
||||
Re: Compare a line of textThank you for the suggestion, TurboPT, I am sure someone else will find it useful too.
Since I was already halfway through my script last night, I decided to go ahead and finish it this morning, and I am happy to announce that it actually works! Online tool: Compare strings or text Although it is not perfect, it will probably help me work on this site's update faster now. The results are also not what I had expected. For example, if I use the strings from my examples above, this is the output from the online tool: OLD Code:
NEW Code:
Of course, it is probably full of bugs as well but I hope to refine it as soon as I am done with the update (of this site). As usual, any feedback is welcome. |
|
#5
|
||||
|
||||
Re: Compare a line of textSelect the 2 versions of the file in Total Commander -> File -> Compare by content
I doubt this tool totally satisfies your needs, but it can be very helpful nevertheless. See attached. Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#7
|
||||
|
||||
Re: Compare a line of textQuote:
Can you make the 2 frames wider? I am trying to test it with some production code from our SVN and it is very hard to read __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#8
|
||||
|
||||
Re: Compare a line of textWidened the table that holds the results a bit. But remember, for the moment this tool only works best for a single line. I have not really done a good job handling newlines and carriage returns... yet.
|
|
#9
|
||||
|
||||
Re: Compare a line of textQuote:
Thanks. Indeed, when I used the content of whole files, the script duplicates some of the text in the displayed result (quite weird). But it works fine on small input. Good job __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#10
|
||||
|
||||
Re: Compare a line of textActually, thanks to you, I found a major problem with this script! Oh well, back to the drawing board. I'll post again if I manage to fix it.
To see an example of the problem, please post: FIRST Code:
SECOND Code:
|
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help! Problems encountered while burning CD's | RayDarkness | Computer Software Forum - Windows | 1 | 18-Nov-2006 05:54 |
| getting an error while compiling and running using different IDE. | jaro | C Programming Language | 0 | 25-Aug-2006 10:14 |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 11:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 12:28 |
| CD Buring Failed | skanth2000 | Computer Hardware Forum | 1 | 15-Nov-2003 04:52 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The