|
This example is a NetRexx command-line application showing file input and output. It converts block-style comments (/* ... */) to NetRexx line comments (-- ...), for comments on the end of a line that contains some other data. It is easily modified to make other changes to the contents of files. Here's the source, as a plain ASCII file (linecomment.nrx). And here's a plain ASCII test file (comment.txt). To run the program, create or copy the 'linecomment.nrx' source file and the 'comment.txt' test file in your current directory, and then enter the commands java COM.ibm.netrexx.process.NetRexxC linecomment java linecomment comment.txt comment.out These would:
Note that the Java toolkit (e.g., from the Java Development Kit, version 1.1.2 or later) must be installed. If you have the netrexxc command script available, you can compile the sample, using just: netrexxc linecommentand then run it using the java command, as before. |