Solved Batch - split html file when matching string is found

July 24, 2015 at 21:23:49
Specs: Windows
I have 1 html file which contains 2 separate html file in it. I want to write a batch file that look for tag , and split original html in 2 html files.

This is what I try

@echo off & setlocal enabledelayedexpansion
SETLOCAL DisableDelayedExpansion
set c=0
for /f "tokens=*" %%a in (split.html) do (
if "%%a" equ "</html>" (
set /a c+=1
>f!c!.html echo.
) else (
>> f!c!.html echo( %%a)
)
)


See More: Batch - split html file when matching string is found

Report •

#1
July 25, 2015 at 20:05:56
✔ Best Answer
It seemed to work fine when I took out this line:
SETLOCAL DisableDelayedExpansion

Report •
Related Solutions


Ask Question