Anonymous user
CSV to HTML translation: Difference between revisions
→{{header|Mathematica}}
Line 1,627:
=={{header|Mathematica}}==
<lang Mathematica>a
(*Naive*)
StringJoin["<table>\n",
,"</table>"]
(*Extra*)
StringJoin["<table>\n",
,Map[StringJoin["<tr><td>",#,"</td></tr>\n"]&,
StringSplit[StringReplace[a,{","->"</td><td>","<"->"<",">"->">"}],"\n"]//Rest]
"</table>"] ▼
Output:
<tr><td>Character</td><td>Speech</td></tr>
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
<tr><td>Brians mother</td><td>
<tr><td>The multitude</td><td>Who are you?</td></tr>
<tr><td>Brians mother</td><td>I'm his mother;that's who!</td></tr>
Line 1,654 ⟶ 1,656:
<table>
<tr><th>Character</
<tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr>
<tr><td>Brians mother</td><td>
<tr><td>The multitude</td><td>Who are you?</td></tr>
<tr><td>Brians mother</td><td>I'm his mother;that's who!</td></tr>
<tr><td>The multitude</td><td>Behold his mother! Behold his mother!</td></tr>
</table></lang>
=={{header|ML/I}}==
|