SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Jan 2005
    Location
    Fort Walton Beach, FL
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Exception Comparing Files

    Hello,

    I'm having a problem comparing files. The twenty first line of the two files I am comparing will always be different (this line is the amount of time it took the computer to complete the file). The other two-hundred plus lines should always be the same. Is there a way in TC3 to allow for this exception? If not, could you recommend a solution to this problem.

    I was trying to find a third party app I could use to open and delete the line in the file before doing the call to compare.

    Currently TC3 is working the way it should, it fails the comparison everytime.

    Suggestions???

  2. #2
    Senior Member
    Join Date
    Oct 2002
    Posts
    254
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Exception Comparing Files

    You could try doing something similar to the following (VBScript):

    set fso = CreateObject("Scripting.FileSystemObject")
    'open the file you want to compare
    set originalFile = fso.OpenTextFile(pathToTheFileYou'reTesting)
    'create an empty text file
    set modifiedFile = fso.OpenTextFile(path)
    'now, read thru each line of the file
    Do while not (originalFile.atEndOfStream)
    text = originalFile.ReadLine
    'if text does not contain whatever's on line
    If not InStr(text,"whateverTextStartsOutLine21") then
    'write that text out to the modified file
    modifiedFile.WriteLine text
    end if
    loop
    set fso = nothing

    Now you can just compare the contents of the modified file to your control document.

    Hope this helps,
    Nick

  3. #3
    Member
    Join Date
    Nov 2001
    Location
    Kiev, Ukraine
    Posts
    38
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Exception Comparing Files

    Originally posted by Cubs4vr:
    [...]Is there a way in TC3 to allow for this exception? If not, could you recommend a solution to this problem.[...]
    <font size="2" face="Verdana, Arial, Helvetica">Hi,

    There is no built-in way to do this. You can try to use the approach suggested by Nick, or consider Regular Expressions.
    A nice example of using Regular Expressions for files comparing was included in the archive with HISUtils plug-in from Eric Holton. Archive for HIS utilities plug-in is available at http://www.automatedqa.com/downloads...te/plugins.asp
    Regards,
    Alex
    [TeamAQA]
    ================================

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:16 PM.

Copyright BetaSoft Inc.