anchor.diff:  move "%flow_file%.log.tmp" "%flow_file%.log" > nul
   
   rem check report option to generate html automation log
  -for /f "usebackq" %%a in ('%flow_file%.log') do set file_size=%%~za
  -if %file_size% gtr 0 if %tagui_html_report%==true php -q tagui_report.php "%flow_file%"
  +for /f "usebackq" %%f in ('%flow_file%.log') do set file_size=%%~zf
  +if %file_size% gtr 0 if %tagui_html_report%==true (
  +	php -q tagui_report.php "%flow_file%"
  +	gawk "sub(\"$\", \"\")" "%flow_file%.html" > "%flow_file%.html.tmp"
  +	move "%flow_file%.html.tmp" "%flow_file%.html" > nul
  +)
   
   rem change back to initial directory where tagui is called
   cd /d "%initial_dir%"
  
positive.code: 
  rem check whether specified automation flow file exists
  if not exist "%~1" (
  echo ERROR - cannot find %~1
  exit /b 1
  )
  
  rem get and set absolute filename of automation flow file
  
negative.code: rem check if api call is made in automation flow file to set appropriate setting for phantomjs to work
  set api=
  if exist "%flow_file%" (
  	find /i /c "api http" "%flow_file%" > nul
  	if not errorlevel 1 set api= --web-security=false
  )
  
  rem check datatable csv file for batch automation
  set tagui_data_set_size=1 
  if not exist "%flow_file%.csv" goto no_datatable
  	for /f "tokens=* usebackq" %%c in (`gawk -F"," "{print NF}" "%flow_file%.csv" ^| sort -nu ^| head -n 1`) do set min_column=%%c
  	for /f "tokens=* usebackq" %%c in (`gawk -F"," "{print NF}" "%flow_file%.csv" ^| sort -nu ^| tail -n 1`) do set max_column=%%c
  	
  	if %min_column% neq %max_column% (
  		echo ERROR - %flow_file%.csv has inconsistent # of columns | tee -a "%flow_file%.log"
  	) else if %min_column% lss 2 (
  		echo ERROR - %flow_file%.csv has has lesser than 2 columns | tee -a "%flow_file%.log"
  	) else (
  		set /a tagui_data_set_size=%min_column% - 1
  	)
  :no_datatable
  
  rem default exit code 0 to mean no error parsing automation flow file
  set tagui_error_code=0
  
  rem loop for managing multiple data sets in datatable
  for /l %%n in (1,1,%tagui_data_set_size%) do (
  set tagui_data_set=%%n
  
  rem parse automation flow file and check for initial parse error before calling casperjs
  php -q tagui_parse.php "%flow_file%" | tee -a "%flow_file%.log"
  for /f "usebackq" %%f in ('%flow_file%.log') do set file_size=%%~zf
  if !file_size! gtr 0 (
  	if !tagui_data_set! equ 1 (
  		echo ERROR - automation aborted due to above | tee -a "%flow_file%.log"
  		set tagui_error_code=1
  		goto break_for_loop
  	)
  )
  
  if %tagui_test_mode%==false (
  	casperjs "%flow_file%.js" %params%%api% | tee -a "%flow_file%.log"
  ) else (
  	casperjs test "%flow_file%.js" %params%%api% --xunit="%flow_file%.xml" | tee -a "%flow_file%.log"
  )
  
  )
  :break_for_loop
  
  rem additional windows section to convert unix to windows file format
  gawk "sub(\"$\", \"\")" "%flow_file%.js" > "%flow_file%.js.tmp"
  