Read a specific line from a file: Difference between revisions

m
→‎{{header|REXX}}: removed superflous blanks. -- ~~~~
(→‎{{header|REXX}}: added comments for sparse files.)
m (→‎{{header|REXX}}: removed superflous blanks. -- ~~~~)
Line 618:
 
=={{header|REXX}}==
<lang REXX>/*REXX program to read a specific line from a file. */
<lang REXX>
/*read a specific line from a file.*/
 
parse arg fileId n . /*get the user args: fileid n */
if fileID=='' then fileId='JUNK.TXT' /*assume the default: JUNK.TXT */
Line 638 ⟶ 636:
otherwise say 'file' fileId "record" n '=' q
end
 
 
/*----------------------------------------------------------------------+
|------ Normally, we could just use: ----- |
Line 651 ⟶ 647:
| |
|---- In the case of sparse files, the record may not exist (be null).|
+----------------------------------------------------------------------*/</lang>
</lang>
 
=={{header|Ruby}}==