Last active
September 15, 2016 11:35
-
-
Save hig3/e2c72c0bee93fe0f628a093aa05da5b3 to your computer and use it in GitHub Desktop.
連結された全員分のレポートのPDFを分割して, manaba courseのレポートに代理一括提出するためのzipファイルを作るバッチファイル
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
@setlocal enabledelayedexpansion | |
rem 1人当たりのページ数 | |
set delta=5 | |
rem 1人目の開始ページ番号(1ページから数える) | |
set s=1 | |
rem 1人目の終了ページ番号(1ページから数える) | |
set e=4 | |
rem 全員分まとめたPDFファイルのファイル名 | |
set source=report_all.pdf | |
rem 配布するPDFファイルのファイル名(全員共通) | |
set distfile=report.pdf | |
rem 名簿ファイル名 | |
set meibo=.\list.csv | |
rem manabaの仕様で決まっているzipフォルダ名 | |
set zipfolder=report_upload | |
for /f "tokens=1 delims=," %%g in (%meibo%) do ( | |
pdftk %source% cat !s!-!e! output %distfile% | |
for /d %%d in (.\%zipfolder%\%%g*) do xcopy /y %distfile% %%d | |
set /a s=%s%+%delta% | |
set /a e=%e%+%delta% | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment