Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
inputString = fileread(csvFileName);
|
||||
% using multiple regular expressions to clear up special chars
|
||||
htmlFriendly = regexprep(regexprep(regexprep(regexprep(inputString,...
|
||||
'&','&'),...
|
||||
'"','"'),...
|
||||
'<','<'),...
|
||||
'>','>');
|
||||
% split string into cell array
|
||||
tableValues = regexp(regexp(htmlFriendly,'(\r\n|\r|\n)','split')',',','split');
|
||||
%%% print in html format %%%
|
||||
% <Extra Credit> first line gets treated as header
|
||||
fprintf(1,['<table>\n\t<tr>' sprintf('\n\t\t<th>%s</th>',tableValues{1,:}{:})])
|
||||
% print remaining lines of csv as html table (rows 2:end in cell array of csv values)
|
||||
cellfun(@(x)fprintf(1,['\n\t<tr>' sprintf('\n\t\t<td>%s</td>',x{:}) '\n\t</tr>']),tableValues(2:end))
|
||||
fprintf(1,'\n</table>')
|
||||
|
|
@ -0,0 +1 @@
|
|||
fprintf(1,['<table>\n\t<tr>\n\t\t<th>',regexprep(regexprep(regexprep(regexprep(regexprep(regexprep(regexprep(regexprep(fileread(cvsFileName),'&','&'),'"','"'),'<','<'),'>','>'),'(?<=(^[^\n\r]*)),','</th>\n\t\t<th>'),'(?<!>)(\r\n|\r|\n)','</td>\n\t<tr>\n\t</tr>\n\t\t<td>'),'</td>\n','</th>\n','once'),',','</td>\n\t\t<td>'),'</td>\n\t</tr>\n</table>\n'])
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<table>
|
||||
<tr>
|
||||
<th>Character</th>
|
||||
<th>Speech</th>
|
||||
<tr>
|
||||
<td>The multitude</td>
|
||||
<td>The messiah! Show us the messiah!</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Brians mother</td>
|
||||
<td><angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry></td>
|
||||
</tr>
|
||||
<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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue