Skip to content

Instantly share code, notes, and snippets.

@liuxd
Last active September 7, 2017 01:44
Show Gist options
  • Save liuxd/489f638ce3b3a94a415d to your computer and use it in GitHub Desktop.
Save liuxd/489f638ce3b3a94a415d to your computer and use it in GitHub Desktop.
[Click me] 帮老婆偷懒的脚本。
@echo off
set "month=%date:~5,2%"
set "day=%date:~8,2%"
set "tmp=result.tmp"
set "result=%month%月%day%日大大集团各省市新闻稿.txt"
set "html=%result%.html"
if exist %tmp% del %tmp%
if exist %result% del %result%
if exist %html% del %html%
for %%i in (*.txt) do (
type "%%i">>%tmp%
echo.>>%tmp%
)
findstr "." "%tmp%">"%result%"
del %tmp%
set "header=<html><body><ul>"
set "footer=</ul></body></html>"
echo "%header%">%html%
for /f "tokens=1,* delims=:" %%a in (%result%) do (
echo "<li><a href='http:%%b' target=__blank>%%a</a></li>">>%html%
)
echo "%footer%">>%html%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment