summaryrefslogtreecommitdiff
path: root/ipl/progs/revfile.icn
diff options
context:
space:
mode:
Diffstat (limited to 'ipl/progs/revfile.icn')
-rw-r--r--ipl/progs/revfile.icn31
1 files changed, 31 insertions, 0 deletions
diff --git a/ipl/progs/revfile.icn b/ipl/progs/revfile.icn
new file mode 100644
index 0000000..d111bc7
--- /dev/null
+++ b/ipl/progs/revfile.icn
@@ -0,0 +1,31 @@
+############################################################################
+#
+# File: revfile.icn
+#
+# Subject: Program to reverse the order of lines in a file
+#
+# Author: Ralph E. Griswold
+#
+# Date: August 11, 1999
+#
+############################################################################
+#
+# This file is in the public domain.
+#
+############################################################################
+#
+# This program reverses the order of lines in a file. Beware of large
+# files.
+#
+############################################################################
+
+procedure main()
+ local lines
+
+ lines := []
+
+ every push(lines, !&input)
+
+ every write(!lines)
+
+end