SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jun 2002
    Location
    Boca Raton FL. USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    masked binary file comparisons

    Greetings,
    We have a need to compare two text files across multiple (Windows and Unix) platforms. Additionally, the comparison must allow certain fields to be ignored (masked) during the comparison. All comparisons are being performed on Windows within SilkTest.
    The process we have used for masked comparisons is to retrieve the file via ftp, read each file into a list of strings and compare each lists' elements, applying our masking rules to the list element (string). Our problem occurs when a unix file is expected to contain a x'0A'.
    An 'ASCII' ftp will automagically convert x'0A' to x'0D0A', causing a comparison failure. A 'BIN'ary transfer inhibits this conversion during transfer, but the SYS_ListRead is apparently performing this comparison anyway.
    Does anyone have any suggestions on how this comparison can be accomplished? We have a large repository of tests where this applies so changing the test data is not desirable.

  2. #2
    Junior Member
    Join Date
    Feb 2002
    Location
    Kiowa, CO,USA
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: masked binary file comparisons

    Here's a WAG, but have you tried StrTran to remove the unwanted CR before making the compare? Ex:

    sLine = StrTran (sLine, Chr (13), "")

    [
    Or perhaps better:
    sLine = StrTran (sLine, "{Chr (13)}{Chr (10)}", "{Chr (10)}")
    ]

    Just a guess...


    ------------------
    Jon A. Lamprech http://www.ameliortech.com
    jlamprech@ameliortech.com

    [This message has been edited by JonL (edited 08-02-2002).]
    Jon A. Lamprech
    jlamprech@yahoo.com

  3. #3
    Junior Member
    Join Date
    Jun 2002
    Location
    Boca Raton FL. USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: masked binary file comparisons

    Thanks for the suggestions!
    It appears that the real issue is that whatever line terminator is in use on the file, the SYS_ListRead consumes the character(s). Because of this, a file using x'0D0A' is deemed a match to a file using x'0A', when they should be identified as different.
    I will take a look at FileCompare and see if this can be made to work for us.

  4. #4
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: masked binary file comparisons

    Check out the FileCompare function on:
    http://www.ameliortech.com/stuff/too...ST/st_file.htm

    It allows for masking....

    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 05:55 PM.

Copyright BetaSoft Inc.