Anonymous user
Read a specific line from a file: Difference between revisions
Read a specific line from a file (view source)
Revision as of 03:20, 17 September 2014
, 9 years ago→{{header|REXX}}: removed needless boilerplate.
(→{{header|Ruby}}: replaced completely using newer methods.) |
(→{{header|REXX}}: removed needless boilerplate.) |
||
Line 998:
<lang REXX>/*REXX program to read a specific line from a file. */
parse arg fileId n . /*get the user args: fileid n */
if fileID=='' then fileId='JUNK.TXT' /*assume
if n=='' then n=7 /*assume
L=lines(fileid) /*first, see if the file exists. */
if L
<br>
▲ when L==0 & qL==0 then say 'line' n "not found."
▲ │ q=linein(fileId,n) /*read a specific record num. */ │
=={{header|Ruby}}==
|