• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Batch] Comparing Text Files

Status
Not open for further replies.
Level 22
Joined
Dec 31, 2006
Messages
2,216
Comparing files in batch is possible I think, but writing everything one has which the other doesn't have is harder and I doubt it's possible. Just use C++ or Java or something similar.
You can easily run other batch files from a C++/Java program and vice versa.
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
I could probably make something like that in Java.

Edit: Do you want to check for certain words or do you want to check each file as a string and then compare the characters in that string?

F.ex.
File 1:
"asdasd"

File 2:
"esdasf"

File 3:
"ef"


Edit: Here it is, I did it like in that example I added, but it checks for things File 1 has which File 2 doesn't have (not what File 2 has which File 1 doesn't have) and it's easy to use. Just make a batch file and put it in the same folder as the .jar file below and do
"File Comparer.jar" <File 1> <File 2> <Result file>

Example:
"File Comparer.jar" Rofl.txt Omg.txt MUahahahahah.txt


If you get any errors or if it's not working correctly please notify me.
 

Attachments

  • File Comparer.rar
    4.2 KB · Views: 36
Last edited:
Level 6
Joined
Mar 22, 2009
Messages
276
It is possible to write the content of a text file into another text file but i don't think it can compare the contents it has. It maybe possible with some programming languages.
 
Level 6
Joined
Mar 22, 2009
Messages
276
I am not sure if string subtraction is possible in batch.
Like:
A = Contents of a.txt
B = Contents of b.txt
C = B - A

We may be able to do that but my mind can't think today. lol
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
The java file I came with supports different file sizes and it doesn't care if the first (or second in the Java app) file got stuff the other file doesn't have.
 
Status
Not open for further replies.
Top