How can I loop over the lines in a text file


1 comment

  • Avatar

    Hi daveb42,

    You could use the below code that iterates between the lines and saves each of them in a variable:

          <setInstallerVariableFromRegEx name="line" pattern="^([^\n]*)(\n|$).*" substitution="\1" text="${text}"/>
          <setInstallerVariableFromRegEx name="text" pattern="^[^\n]*(\n|$)(.*)" substitution="\2" text="${text}"/>
          <!-- Actions to be executed. The line variable have the content of the currently line -->
            <regExMatch text="${text}" logic="matches" pattern="[^\n]+.*(\n|$)"/>
    Comment actions Permalink

Please sign in to leave a comment.