anchor.diff:  echo Version 1.1.0 >> !TampFileName!.tmp
   
   echo ################
  -echo Disk detect...
  -echo ################
  -
  -for /f "tokens=2,3" %%a in ('echo list disk ^| diskpart') do ( 
  -    set DiskNum=%%a )
  +echo disksort.txt has xx lines
  +echo ################
  +
  +set file=disksort.txt
  +set /a cnt=0
  +for /f %%a in ('type "%file%"^|find "" /v /c') do set /a cnt=%%a
  +echo %file% has %cnt% lines
  +
  +set DiskNum=%cnt%
  +
  +::echo ################
  +::echo get spic disk info 
  +::echo ################
  +
  +::for /f "tokens=1,2,3,4,5* " %%i in (1.tmp) do (
  +::    set TargetID=%%i
  +::	set TargetFW=%%j
  +::	set AssignedName=%%k
  +::   if "%%n"=="" if "%%m"=="" (
  +::	    set TargetName=%%l
  +::	)else if "%%n"=="" (
  +::	    set TargetName=%%l %%m
  +::	)else (
  +::	    set TargetName=%%l %%m %%n
  +::	)
  +::)
  +
   
   echo ################
   echo Start carte many icf file 
   echo ################
   echo.
   
  -::set DiskNum=26
  +::set DiskNum=5
   set FileName=00
   
   for /L %%i in (1, 1, %DiskNum%) do (
       set "formattedValue=000000%%i"
   	set FileName=!formattedValue:~-2!
       echo !FileName!.icf
  +    for /f "tokens=1,2,3,4 delims=," %%a in (%%i.tmp) do (
  +        set TargetID=%%a
  +	    set TargetFW=%%b
  +		set AssignedName=%%c
  +	    set TargetName=%%d
  +    )	
  +	echo !AssignedName! !TargetID! !TargetName! !TargetFW!
   	:: imput icf_info_top
   	type icf_info_top.tmp                               >> !FileName!.icf
   	    :: imput icf_Worker_info_top(outstanding=8)
  
positive.code: 	    :: imput icf_Worker_mid_top	 
  	    type icf_Worker_info_mid_top.tmp                >> !FileName!.icf
  	    echo 	8,DISABLED,1,DISABLED,0 >> !FileName!.icf
  	    :: imput icf_Worker_info_mid_bot
  	    type icf_Worker_info_mid_bot.tmp                >> !FileName!.icf
  	    echo     %%i: "">> !FileName!.icf
  	    :: imput icf_Worker_info_bot
  	    type icf_Worker_info_bot.tmp                    >> !FileName!.icf
  	:: imput Other Worker info(outstanding=1)
  	for /L %%j in (2, 1, %DiskNum%) do (
  	    if %%i==%%j (
  		    :: imput icf_Worker_info_top
  	        type icf_Worker_info_top.tmp                >> !FileName!.icf
              echo     Worker %%j >> !FileName!.icf
  	        :: imput icf_Worker_mid_top	 
  	        type icf_Worker_info_mid_top.tmp            >> !FileName!.icf
  	        echo 	1,DISABLED,1,DISABLED,0 >> !FileName!.icf
  	        :: imput icf_Worker_info_mid_bot
  	        type icf_Worker_info_mid_bot.tmp            >> !FileName!.icf
  	        echo     1: "" >> !FileName!.icf
  		    :: imput icf_Worker_info_bot
  	        type icf_Worker_info_bot.tmp                >> !FileName!.icf
  	    )else (
  		    :: imput icf_Worker_info_top
  	        type icf_Worker_info_top.tmp                >> !FileName!.icf
              echo     Worker %%j >> !FileName!.icf
  	        :: imput icf_Worker_mid_top	 
  	        type icf_Worker_info_mid_top.tmp            >> !FileName!.icf
  	        echo 	1,DISABLED,1,DISABLED,0 >> !FileName!.icf
  	        :: imput icf_Worker_info_mid_bot
  	        type icf_Worker_info_mid_bot.tmp            >> !FileName!.icf
  	        echo     %%j: "" >> !FileName!.icf
  	        :: imput icf_Worker_info_bot
  	        type icf_Worker_info_bot.tmp                >> !FileName!.icf     
  	    )
  
negative.code: echo ################
  
  echo ################
  echo Get diskdrive get FirmwareRevision, Index, InterfaceType, Model
  echo ################
  ::ic diskdrive get              %%i,   %%j,           %%k,   %%l
  wmic diskdrive get FirmwareRevision, Index, InterfaceType, Model  > diskdrive.tmp
  type diskdrive.tmp > diskdrive.txt
  
  for /f "skip=1 tokens=1,2,3,4,5* " %%i in (diskdrive.txt) do (
      set "formattedValue=%%l %%m %%n"
  	set /A a=100+%%j
      if %%j==%SystemDriveID% (
          echo REMOVE %%j !formattedValue:~0,20! %%i -- THIS IS OS DISK
      )else (
  		set b=SAS_2K
  		if %%k==IDE (
  		    set b=SATA_6K
  		    ::echo !a:~1! !formattedValue:~0,20! %%i 
  		    set "line[!a:~1!]=%%j %%i !b! ^(!formattedValue:~0,20! 
  		)else if %%l==ATA (
  			set b=SATA_6K
              set "line[!a:~1!]=%%j %%i !b! !formattedValue:~0,20!
          )else (
              set "line[!a:~1!]=%%j %%i !b! !formattedValue:~0,20!
  		)	    
      )
  )
  
  if exist disksort.txt del /Q disksort.txt
  
  ::Show array elements
  ::sort diskdrive.txt
  for /F "tokens=2 delims==" %%a in ('set line[') do echo %%a >> disksort.tmp
  type disksort.tmp
  
  echo ################
  echo Get disksort.tmp file line-------------
  echo ################
  set file=disksort.tmp
  set /a cnt=0
  for /f %%a in ('type "%file%"^|find "" /v /c') do set /a cnt=%%a
  echo %file% has %cnt% lines
  
  set DiskNum=%cnt%
  
  echo ################
  echo Get disksort.txt file-------------
  echo ################
  
  set "myfile=disksort.tmp"
  set "outputfile=disksort.txt"
  
  for /f "tokens=*" %%a in ('type "%myfile%" ^| find /v /n "" ^& break ^> "%myfile%"') do (
       set "str=%%a
       set "str=!str:]= !"
       set "str=!str:[=!"
       >>%outputfile% echo(!str!
  )
  
  
  echo ################
  echo Get 1~%DiskNum%.tmp file-------------
  echo ################
  
  for /f "tokens=1,2,3,4,5,6,7" %%i in (disksort.txt) do (
      set work=%%i
  	echo i="%%i",j="%%j",k="%%k",l="%%l",m="%%m",n="%%n",o="%%o",
      if "%%o"=="" if "%%n"=="" (
  	    echo 11 i="%%i",j="%%j",k="%%k",l="%%l",m="%%m",n="%%n",o="%%o",
  	    echo %%j,%%k,%%l,%%m, > !work!.tmp
  	    )else if "%%o"=="" (
  	        echo 22 i="%%i",j="%%j",k="%%k",l="%%l",m="%%m",n="%%n",o="%%o",
  	        echo %%j,%%k,%%l,%%m %%n, > !work!.tmp
  	    )else (
  	        ::echo 33 i="%%i",j="%%j",k="%%k",l="%%l",m="%%m",n="%%n",o="%%o",
  	        ::echo %%j,%%k,%%l,%%m, > !work!.tmp
  	)else (
  		echo 44 i="%%i",j="%%j",k="%%k",l="%%l",m="%%m",n="%%n",o="%%o",
  	    echo %%j,%%k,%%l,%%m %%n %%o, > !work!.tmp
  	)
  )
  
  
  
  echo ################
  echo Careate icf_info.tmp file
  