• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

compare contents of two files using regex  RSS feed

 
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.
 
Rancher
Posts: 42974
76
  • 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: 42974
76
  • 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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!