FileDocCategorySizeDatePackage
LineCat.javaAPI DocExample622Sun Mar 28 19:09:04 BST 1999None

LineCat

public class LineCat extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

  
    String thisLine;
 
    // Loop across the arguments
    for (int i=0; i < args.length; i++) {
 
     //Open the file for reading
     try {
       LineNumberReader br = new LineNumberReader(new FileReader(args[i]));
       while ((thisLine = br.readLine()) != null) { 
         System.out.println(br.getLineNumber() + ": " + thisLine);
        } // end while 
      } // end try
      catch (IOException e) {
        System.err.println("Error: " + e);
      }
    } // end for