Created
July 29, 2016 04:38
-
-
Save libliflin/8c666fefce032ab23ac1fd14509f94be to your computer and use it in GitHub Desktop.
Pull 616 Example SQL statements from the oracle 10g documentation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
del examples-* | |
setlocal enableDelayedExpansion | |
rem wget -r -np https://docs.oracle.com/cd/B14117_01/server.101/b10759/statements_9014.htm#SQLRF01604 | |
rem sift-tool.org | |
rem gnuwin32 | |
rem sublime | |
rem lots of stackoverflow answers. | |
@FOR %%G IN (*.htm) DO if "" == "" ( | |
sift -m "color=\"#330099\"[>]Examples.*" %%G | sift -m "<pre(.*?)>(.*?)</pre>" --replace "33333$2" > examples-%%G | |
rem could not use csplit; it was only giving one line? | |
set out_file_counter=0 | |
for /f "usebackq delims=" %%L in (examples-%%G) do ( | |
set line=%%L | |
if "!line:~0,5!" equ "33333" ( | |
set /a out_file_counter=out_file_counter+1 | |
) | |
echo !line!>>examples-%%G0!out_file_counter! | |
) | |
FOR %%K IN (examples-%%G0*) DO if "" == "" ( | |
sift -m "33333(.*)" %%K --replace "$1" > %%K.sql | |
del %%K | |
) | |
) | |
endlocal | |
subl examples-statements_9014.htm01.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment