Break ON $items = ReadExcel2('c:\SageSchedule.txt',,-1,12) Open(1,"c:\SageRecordingSchedule.csv",5) For $counter=1 to ubound($items,1) $Encoder=""+$items[$counter,0] $StartTime=""+$items[$counter,1] $StopTime=""+$items[$counter,2] $Duration=""+$items[$counter,3] $ChannelName=""+$items[$counter,4] $ChannelNum=""+$items[$counter,5] $Title=""+$items[$counter,6] $ManualRecord=""+$items[$counter,7] $Favorite=""+$items[$counter,8] IF ManualRecord="-1" OR $Favorite="-1" WriteLine(1,$StartTime+","+$StopTime+","+$ChannelNum+","+$ChannelName+","+$Title+","+@CRLF) ENDIF Next Close(1) ;ReadExecel2 Function Code Function ReadExcel2($xlsFile,optional $xlsWS,optional $RowCount,optional $ColCount,optional $RowStart,optional $ColStart) dim $xlObj,$Counter,$Counter2 If 0=Exist($xlsFile) exit 2 Endif $xlObj=Createobject('Excel.application') If @error Exit 1154 Endif $xlObj.workbooks.open($xlsFile). if 8<>vartype($xlsFile) exit 87 endif if vartype($xlsWS) if 3<>vartype($xlsWS) exit 87 endif if 1>$xlsWS exit 87 endif $xlObj.sheets($xlsWS).Activate. else $xlsWS=1 endif if vartype($RowCount) if 3<>vartype($RowCount) exit 87 endif if -1=$RowCount for $Counter=1 to $xlObj.sheets($xlsWS).rows.count if not $xlObj.cells($Counter,1).value $RowCount=$Counter-1 $Counter=$xlObj.sheets($xlsWS).rows.count endif next endif else $RowCount=$xlObj.sheets($xlsWS).rows.count endif if vartype($ColCount) if 3<>vartype($ColCount) exit 87 endif if -1=$ColCount for $Counter=1 to $xlObj.sheets($xlsWS).columns.count if not $xlObj.cells(1,$Counter).value $ColCount=$Counter-1 $Counter=$xlObj.sheets($xlsWS).columns.count endif next endif else $ColCount=$xlObj.sheets($xlsWS).columns.count endif if vartype($RowStart) if 3<>vartype($RowStart) exit 87 endif if 1>$RowStart exit 87 endif else $RowStart=1 endif if vartype($ColStart) if 3<>vartype($ColStart) exit 87 endif if 1>$ColStart exit 87 endif else $ColStart=1 endif dim $Array[$RowCount-1,$ColCount-1] $ReadExcel2=$Array for $Counter=1 to $RowCount-$RowStart+1 for $Counter2=1 to $ColCount-$ColStart+1 $ReadExcel2[$Counter-1,$Counter2-1]=$xlObj.cells($Counter,$Counter2).value next next $xlObj.workbooks.Close. $xlObj.quit EndFunction