Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
::Batch Files are terrifying when it comes to string processing.
|
||||
::But well, a decent implementation!
|
||||
@echo off
|
||||
|
||||
REM Below is the CSV data to be converted.
|
||||
REM Exactly three colons must be put before the actual line.
|
||||
|
||||
:::Character,Speech
|
||||
:::The multitude,The messiah! Show us the messiah!
|
||||
:::Brians mother,<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
|
||||
:::The multitude,Who are you?
|
||||
:::Brians mother,I'm his mother; that's who!
|
||||
:::The multitude,Behold his mother! Behold his mother!
|
||||
|
||||
setlocal disabledelayedexpansion
|
||||
echo ^<table^>
|
||||
for /f "delims=" %%A in ('findstr "^:::" "%~f0"') do (
|
||||
set "var=%%A"
|
||||
setlocal enabledelayedexpansion
|
||||
REM The next command removes the three colons...
|
||||
set "var=!var:~3!"
|
||||
|
||||
REM The following commands to the substitions per line...
|
||||
set "var=!var:&=&!"
|
||||
set "var=!var:<=<!"
|
||||
set "var=!var:>=>!"
|
||||
set "var=!var:,=</td><td>!"
|
||||
|
||||
echo ^<tr^>^<td^>!var!^</td^>^</tr^>
|
||||
endlocal
|
||||
)
|
||||
echo ^</table^>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<table>
|
||||
<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><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