It's obvious that u don't need to use QTP to do that. Use scripting.fileSystemObject to read each and every line from the file and store in the arrays. Do the same thing for other file and compare both the arrays. There are many ways to do this and the one i suggested is one of them. If you are specifically looking towards QTP to do this i am afraid QTP has no specific method. May be other members confirm this.
Senior QA Engineer,
Virtusa India Pvt Ltd,
There are several other posts on this site and on the Internet dealing with comparing two files with VB Script. Do some research and you will find the answer. The following works for me. Good luck Senthilb.
'Return values: 0 files are not different, 1 files are different, 2 file not found.
Public Function CompareFiles(File1, File2)
Dim WshShell, fso, CmdStr, ResultFile
Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(ResultFile) Then fso.DeleteFile(ResultFile)
CmdStr = "CMD /c FC "&Chr(34)&File1&Chr(34)&" "&Chr(34)&File2&Chr(34)&" >"&ResultFile 'Use CMD /c FC /b for binary comparison.
CompareFiles = WshShell.Run(CmdStr, 1, True)