💾 Archived View for uhc.driar.se › help › ForEachLine captured on 2022-07-16 at 13:30:32.

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

ForEachLine - Loops through a textfile, line by line

Usage: ForEachLine FROMFILE/A

FROMFILE/A: File to loop through

A very usable tool for scripting, it loops through a textfile line by line
and sets the ENV-variable LINE for each iteration.

Lets say we have the following script:
 ForEachLine RAM:example
  Echo "The current line contents is: $LINE"
 EndForEach

And the contents of RAM:example are the following:
 Line 1
 Line 2
 Line 3

When you run the script you will get the following output:
 The current line contents is: Line 1
 The current line contents is: Line 2
 The current line contents is: Line 3

EndForEach is used at the end of the loop, and BreakForEach is used to break
out of a loop early.