Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compare contents of two files using regex

 
Kamal Ahmed
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could anyone give me some hint, as to how i can compare two files which are contain lines using the following encoding schemes:


US-ASCII
ISO-8859-1
UTF-8 Eight-bit
UTF-16BE Sixteen-bit
UTF-16LE Sixteen-bit
UTF-16 Sixteen-bit UCS


Let me know if further information is required.
I would appreciate ANY hint/help

Thanks,
-Kamal.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by compare - do you want to know which lines are added or omitted from one or the other file (in which case one of the numerous "diff"-like tools would do the trick), or do you need to compare the contents of individual lines as well?
 
Kamal Ahmed
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
need to compare the contents of individual lines , one example of a line is:

WEBMETHODS: localhost ort - (WEBMETHODS.DEFAULT.TestComponentId.TestSubcomponentId) [TestComponentId.TestSubcomponentId.?] 2006-08-08 18:15:56.169 EDT INFO: ?


I could not paste the UTF-16 format here
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so say you have two lines that look just about like the one you posted - what should be the desired output? Would those two lines you're comparing be in the same file, or in different files?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic