@echo off
if "%1"=="" goto error
if not exist "JLearnIt.jar" goto error
if "%2"=="" goto process1

java -cp JLearnIt.jar jlearnit.data.FileSplitter %2 %2.temp1 %1
java -cp JLearnItPDA.jar;SuperWaba\superwaba.jar jlearnit.JLearnItTxt2J2ME %2.temp1
del %2.temp1
goto end

:process1
java -cp JLearnIt.jar jlearnit.data.FileSplitter vocabulary.txt vocabulary.temp1 %1
java -cp JLearnItPDA.jar;SuperWaba\superwaba.jar jlearnit.JLearnItTxt2J2ME vocabulary.temp1
del vocabulary.temp1
goto end

:error
echo Syntax: convert2ME <sections> [<input file>]
echo e.g. convert2ME 1_3_5
echo e.g. convert2ME 0_1_2_3_4_5_6_7_8_9_10_11_12_13_14
echo Please also copy JLearnIt.jar to this directory
pause
goto end

:end
