Selective file copy: Difference between revisions

add Rexx
(add task)
 
(add Rexx)
Line 38:
</lang>
{{out}}
<pre>AA 01XXXXX
AAA 02XXXXX
AAAA 03XXXXX
AAAAA04XXXXX
AAAAA05XXXXX</pre>
 
=={{header|Rexx}}==
{{trans|PL/I}}
<lang rexx>in='in.txt'
out='out.txt'; 'erase' out
Do While lines(in)>0
l=linein(in)
Parse Var l a +5 b +5 c +4 d +5
chex=c2x(c)
cpic=left(chex,2)
call lineout out,a||cpic||'XXXXX'
End
Call lineout in
Call lineout out
'type' out</lang>
{{out}}
Using the test file produced by PL/I.
The data conversion used for c is not very general!
<pre>AA 01XXXXX
AAA 02XXXXX
2,295

edits