Find text in file

Comments

1 comment

  • Avatar
    jesus

    You can use the compareText rule to check if a file contains a specific text. Find below an example:

        <readFile path="${installdir}/myclass.java" name="javaclass"/>
    
        <showInfo text="CONTAINS!!">
            <ruleList>
                <compareText>
                    <logic>contains</logic>
                    <text>${javaclass}</text>
                    <value>str.contains("foo")</value>
                </compareText>
            </ruleList>
        </showInfo>
    
    0
    Comment actions Permalink

Please sign in to leave a comment.