CSV to HTML translation: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: added what commands were used verifying the output renderings. -- ~~~~) |
(→{{header|REXX}}: added the '''changestr''' bif. -- ~~~~) |
||
Line 2,768: | Line 2,768: | ||
<br> <tt> file:///c:/output.html </tt> ''and'' |
<br> <tt> file:///c:/output.html </tt> ''and'' |
||
<br> <tt> file:///c:/outputh.html </tt> |
<br> <tt> file:///c:/outputh.html </tt> |
||
<br><br>Some older REXXes don't have the '''changestr''' bif, so one is included here. |
|||
<lang rexx>/*REXX program to convert CSV ───> HTML table representing the CSV data.*/ |
<lang rexx>/*REXX program to convert CSV ───> HTML table representing the CSV data.*/ |
||
arg header_ . /*see if the user wants a header.*/ |
arg header_ . /*see if the user wants a header.*/ |
||
wantsHdr=header_=='HEADER' /*arg (low/upp/mix case)=HEADER ?*/ |
wantsHdr=header_=='HEADER' /*arg (low/upp/mix case)=HEADER ?*/ |
||
Line 2,802: | Line 2,802: | ||
call write ,'</html>' |
call write ,'</html>' |
||
exit |
exit |
||
/*───────────────────────────CHANGESTR subroutine───────────────────────*/ |
|||
changestr: procedure; parse arg o,h,n; r=; w=length(o); if w==0 then return n||h |
|||
do forever; parse var h y (o) _ +(w) h; if _=='' then return r||y; r=r||y||n; end |
|||
/*─────────────────────────────────────WRITE subroutine─────────────────*/ |
/*─────────────────────────────────────WRITE subroutine─────────────────*/ |
||
write: call lineout oFID,left('',0||arg(1))arg(2); return</lang> |
write: call lineout oFID,left('',0||arg(1))arg(2); return</lang> |