NetRexx logo
   1: /* NetRexx */
   2: 
   3: class ReadFileByLines public implements LineHandler
   4: 
   5: properties private static
   6:     fileName = String
   7:     lineNo = 0
   8: 
   9: method main(args=String[]) public static
  10:     lineHandler = ReadFileByLines()
  11:     loop fileName over args
  12:         lineNo = 0
  13:         inputFile = RexxIO().File(fileName)
  14:         if (inputFile<>null) 
  15:             then inputFile.forEachline(lineHandler)
  16:             else say "File:" fileName "cannot be found!"
  17:     end
  18: 
  19: method handle(line)
  20:     lineNo = lineNo+1
  21:     say fileName':' lineNo "-" line
  22: 
If you feel inclined to make corrections, suggestions etc., please mail me any.
All content © Ruurd Idenburg, 2007–, except where marked otherwise. All rights reserved. This page is primarily for non-commercial use only. The Idenburg website records no personal information and sets no ‘cookies’. This site is hosted on a VPS(Virtual Private System) rented from Transip.nl, a Dutch company, falling under Dutch (privacy) laws (I think).

This page updated on by Ruurd Idenburg.