Jump to content
Sign in to follow this  
NickT

Array to Excel

Recommended Posts

NickT

I believe it's time to consult the experts on what I am trying to do...I am trying to take a large text file and write it to an Excel spreadsheet. After 2 days of trial and error I finally got it to work. What I would like help with is on making it faster. In my opinion it is taking WAY too long to write these values to the worksheet.

SCRIPT:

test.au3

TEXT FILE:

aptsource.txt

Share this post


Link to post
Share on other sites
water

Didn't have a look at your script in detail. You could try my UDF (Attention! Alpha version!) and use the _Excel_RangeWrite function to write an array to a worksheet. Or use the _Excel_BookOpenText function to directly read the file into a sheet.

That's much faster!


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
NickT

Okay, I tried using the _Excel_BookOpenText function with no luck. I keep getting a failed object error on it.

Share this post


Link to post
Share on other sites
water

Can you post your code?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
NickT

#include <Excel.au3>

#include <File.au3>

#include <String.au3>

#include <Array.au3>

Global $ext,$slnum = "-1"

Func write($book,$val,$row,$x,$y,$z)

$zVAL = _ExcelReadCell($book,$row - 1,3)

If _ExcelReadCell($book,$row,3) = $zVAL Then

_ExcelWriteCell($book,$slnum,$row,10)

Else

$slnum += 1

_ExcelWriteCell($book,$slnum,$row,10)

EndIf

_ExcelWriteCell($book,$x,$row,7)

_ExcelWriteCell($book,$y,$row,8)

_ExcelWriteCell($book,$z,$row,9)

If Number(Round(($row - 2) / $val * 100)) > "0" Then

$per = Round(($row - 2) / $val * 100)

ProgressSet($per,$per & " Percent complete")

EndIf

EndFunc

Func parse($file,$tmpfile,$book,$lcount)

ProgressOn("AptSource Conversion","","",1,1)

Local $line

If Not StringInStr(FileRead($file),"GOTO",1) Then

MsgBox(0,"ERROR",'This is not an "aptsource" file.')

ex($book,$tmpfile)

EndIf

_ExcelWriteCell($book,"in machine datum : xm=-zb ; ym=-xb ; zm=yb with rotation (0.223deg)",1,1)

_ExcelWriteCell($book,"Xc",2,1)

_ExcelWriteCell($book,"Yc",2,2)

_ExcelWriteCell($book,"Zc",2,3)

_ExcelWriteCell($book,"i",2,4)

_ExcelWriteCell($book,"j",2,5)

_ExcelWriteCell($book,"k",2,6)

_ExcelWriteCell($book,"x+i",2,7)

_ExcelWriteCell($book,"y+j",2,8)

_ExcelWriteCell($book,"z+k",2,9)

_ExcelWriteCell($book,"scan line " & @CRLF & "number",2,10)

_ExcelHorizontalAlignSet($book,1,1,1,1,"center")

$book.Range($book.Cells(1,1),$book.Cells(1,10)).MergeCells=True

$book.Columns.NumberFormat="@"

$read = StringReplace(FileRead($file),"GOTO","",0,1);_StringStripChr(FileRead($file),"GOTO/ ",8)

$read = StringReplace($read," ","",0,1)

$read = FileWrite($tmpfile,StringReplace($read,"/","",0,1))

For $i = 1 To $lcount

$read = FileReadLine($tmpfile,$i)

$read = _StringExplode($read,",")

$x = StringReplace($read[0] + $read[3],".",",")

$y = StringReplace($read[1] + $read[4],".",",")

$z = StringReplace($read[2] + $read[5],".",",")

$read = StringReplace(_ArrayToString($read),".",",")

$read = _StringExplode($read,"|")

_ExcelWriteArray($book, $i + 2, 1, $read)

write($book,$lcount,$i + 2,$x,$y,$z)

Next

$book.columns.autofit

$folder = FileSaveDialog("Save",@ScriptDir,"Excel (*.xlsx)",18)

$book.ActiveWorkbook.SaveAs($folder);,"","",False,False,1,2,False)

MsgBox(0,"",@error)

ex($book,$tmpfile)

EndFunc

Func lcount($file)

If $file = "" Then Exit

Local $line

_FileReadToArray($file,$line)

parse($file,_TempFile(),_ExcelBookNew(1),$line[0])

EndFunc

Func ex($book,$tmpfile)

ProgressOff()

_ExcelBookClose($book,0)

FileDelete($tmpfile)

EndFunc

lcount(FileOpenDialog("Open","","All(*.*)",3))

Edited by NickT

Share this post


Link to post
Share on other sites
water

Sorry, my bad.

I didn't mean the original code which you already posted in #1 but the code where _Excel_BookOpenText didn't work.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
NickT

Apologies for taking so long, been busy. Here is my code with _Excel_BookOpenText not working.

#include <Excel.au3>
#include <File.au3>
#include <String.au3>
#include <Array.au3>

Global $ext,$slnum = "-1"

Func write($book,$val,$row,$x,$y,$z,$time)
Local $per,$min[1]
_ExcelWriteCell($book,$x,$row,7)
_ExcelWriteCell($book,$y,$row,8)
_ExcelWriteCell($book,$z,$row,9)
$zVAL = _ExcelReadCell($book,$row - 1,3)
If _ExcelReadCell($book,$row,3) = $zVAL Then
_ExcelWriteCell($book,$slnum,$row,10)
Else
$slnum += 1
_ExcelWriteCell($book,$slnum,$row,10)
EndIf
If Number(Round(($row - 2) / $val * 100)) > "0" Then
$per = Round(($row - 2) / $val * 100)
; ProgressSet($per,$per & " Percent complete" & @CRLF & @CRLF & Round(TimerDiff($time) / 1000))
EndIf
$dif = Round(TimerDiff($time) / 1000)
If $dif >= "60" Then
$min[0] = $dif / 60
If StringInStr($min[0],".") Then $min[0] = _StringBetween($min,"",".")
Else
$min[0] = 0
EndIf
$sec = $dif / 60
$sec = _StringBetween($sec,".","")
$sec = _StringInsert(_ArrayToString($sec),".",0)
$sec = Round($sec * 60)
ProgressSet($per,$per & " Percent complete" & @CRLF & @CRLF & "Time elapsed: " & $min[0] & " minutes and " & $sec & " seconds")
EndFunc

Func parse($file,$tmpfile,$book,$lcount)
$time = TimerInit()
ProgressOn("AptSource Conversion","","",1,1,18)
Local $line
If Not StringInStr(FileRead($file),"GOTO",1) Then
MsgBox(0,"ERROR",'This is not an "aptsource" file.')
ex($book,$tmpfile)
EndIf
_ExcelWriteCell($book,"in machine datum : xm=-zb ; ym=-xb ; zm=yb with rotation (0.223deg)",1,1)
_ExcelWriteCell($book,"Xc",2,1)
_ExcelWriteCell($book,"Yc",2,2)
_ExcelWriteCell($book,"Zc",2,3)
_ExcelWriteCell($book,"i",2,4)
_ExcelWriteCell($book,"j",2,5)
_ExcelWriteCell($book,"k",2,6)
_ExcelWriteCell($book,"x+i",2,7)
_ExcelWriteCell($book,"y+j",2,8)
_ExcelWriteCell($book,"z+k",2,9)
_ExcelWriteCell($book,"scan line " & @CRLF & "number",2,10)
_ExcelHorizontalAlignSet($book,1,1,1,1,"center")
$book.Range($book.Cells(1,1),$book.Cells(1,10)).MergeCells=True
$book.Columns.NumberFormat="@"
$read = StringReplace(FileRead($file),"GOTO","",0,1)
$read = StringReplace($read," ","",0,1)
$read = FileWrite($tmpfile,StringReplace($read,"/","",0,1))
_Excel_BookOpenText($book,$tmpfile,3,1,Default,Default,",",2,Default,Default,Default)
; For $i = 1 To $lcount
; $read = FileReadLine($tmpfile,$i)
; If @error Then
; MsgBox(0,"",$read & @CRLF & $i & @CRLF & $lcount)
; ExitLoop
; EndIf
; $read = _StringExplode($read,",")
; $x = StringReplace($read[0] + $read[3],".",",")
; $y = StringReplace($read[1] + $read[4],".",",")
; $z = StringReplace($read[2] + $read[5],".",",")
; $read = StringReplace(_ArrayToString($read),".",",")
; $read = _StringExplode($read,"|")
; _ExcelWriteArray($book, $i + 2, 1, $read)
; write($book,$lcount,$i + 2,$x,$y,$z,$time)
; Next
$book.columns.autofit
$folder = FileSaveDialog("Save",@ScriptDir,"Excel (*.xlsx)",18)
$book.ActiveWorkbook.SaveAs($folder)
ex($book,$tmpfile)
EndFunc

Func lcount($file)
If $file = "" Then Exit
Local $line
_FileReadToArray($file,$line)
parse($file,_TempFile(),_ExcelBookNew(0),$line[0])
EndFunc

Func ex($book,$tmpfile)
ProgressOff()
_ExcelBookClose($book,0)
FileDelete($tmpfile)
EndFunc

lcount(FileOpenDialog("Open","","All(*.*)",3))
Apologies for taking so long, been busy. Here is my code with _Excel_BookOpenText not working.

Share this post


Link to post
Share on other sites
water

You can't combine the Excel UDF that comes with AutoIt and my rewrite of the Excel UDF.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
NickT

I've tried it both ways, using your rewrite and $book.OpenText method.

-- Note that I have not only tried $book.OpenText but also $book.ActiveWorkbook.OpenText and $book.Workbooks.OpenText.

Share this post


Link to post
Share on other sites
water

If you run the _Excel_BookOpenText.au3 example of my rewritten Excel UDF. Does it work?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
NickT

Sweet! That works like I wanted it too! Is there any way to attach the "OpenText" book that is created to the previously created workbook instead of having two seperate books? I've looked around _ExcelBookAttach but it doesn't seem to be what I'm looking for. Of course I'm probably wrong.

Share this post


Link to post
Share on other sites
water

Not at the moment. The Excel method OpenText is only available for workbooks.

What should be possible is to copy the worksheet to another book.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
NickT

I suppose what I could do is close the unused book and set my variable to the new book. Thank you for all of your help. It is greatly appreciated!

Share this post


Link to post
Share on other sites
water

I will test how to copy a worksheet from one workbook to another tomorrow.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

How to copy a worksheet from one workbook to another:

#include <Excel Rewrite.au3>
$oExcel = _Excel_Open()
$oBook1 = _Excel_BookOpen($oExcel, @ScriptDir & "\_Excel1.xls")
$oSheet1 = $oBook1.Sheets(1)
$oBook2 = _Excel_BookOpen($oExcel, @ScriptDir & "\_Excel2.xls")
MsgBox(0, "", "Copying sheet1 of workbook1 before sheet1 of workbook2")
$oSheet1.Copy($oBook2.Sheets(1))
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
NickT

I finally got the script to work. Thanks for your help. I have another question that pertains to the same script but this is more of a "want to know how" sort of deal. I'm wondering what makes this work:

dim $Array1[2]=[0,2]

dim $Array2[2]=[7,2]

dim $Array3[2]=[41,2]

dim $Array4[2]=[47,2]

dim $Array5[2]=[61,1]

dim $Array6[2]=[98,1]

dim $Array7[2]=[99,1]

dim $ArrayComplet[7]=[$Array1,$Array2,$Array3,$Array4,$Array5,$Array6,$Array7]

When I run _ArrayDisplay($ArrayComplet) I get 7 rows, 1 column, and no values. I use this in my script but I just want to know how this is working. This came from

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\..\..\..\Program Files (x86)\AutoIt3\Icons\au3.ico
#AutoIt3Wrapper_Outfile=AptSource_Converter.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include
#include
#include

Func parse($file,$tmpfile,$book,$lcount)
Dim $arr0[2] = [0,2]
Dim $arr1[2] = [1,2]
Dim $arr2[2] = [2,2]
Dim $arr3[2] = [3,2]
Dim $arr4[2] = [4,2]
Dim $arr5[2] = [5,2]
Dim $arr6[2] = [6,2]
Dim $arr7[2] = [7,2]
Dim $arr8[2] = [8,2]
Dim $arr9[2] = [9,2]
Dim $array[10] = [$arr0,$arr1,$arr2,$arr3,$arr4,$arr5,$arr6,$arr7,$arr8,$arr9]
$tmpfile2 = _TempFile()
If Not StringInStr(FileRead($file),"GOTO",1) Then
MsgBox(0,"ERROR",'This is not an "aptsource" file.')
ex($book,$tmpfile,$tmpfile2,"")
EndIf
ProgressOn("Converting","","",1,1,18)
$read = StringReplace(FileRead($file),"GOTO","",0,1)
$read = StringReplace($read," ","",0,1)
$read = FileWrite($tmpfile,StringReplace($read,"/","",0,1))
$book.Application.DisplayAlerts=0
$book.Workbooks.OpenText($tmpfile,Default,1,Default,1,False,False,False,True,False,False,"",$array, Default,Default,Default,True)
_ExcelWriteCell($book,0,1,10)
$book.Range($book.Cells(1,7),$book.Cells($lcount,9)).Formula="=A1:A" & $lcount & "+D1:D" & $lcount
$book.Range($book.Cells(2,10),$book.Cells($lcount,10)).Formula="=IF(C2=C1,J1,J1+1)"
MsgBox(0,"","")
$book.ActiveWorkbook.SaveAs($tmpfile,20,Default,Default,False,False,1,2)
_ExcelBookClose($book,0)
ProgressSet(25,"25 percent complete" & @CRLF & @CRLF & $file)
$read = StringReplace(FileRead($tmpfile),".",",")
FileWrite($tmpfile2,$read)
ProgressSet(50,"50 percent complete" & @CRLF & @CRLF & $file)
$book = _ExcelBookNew(0)
$book.Application.DisplayAlerts=0
$book.Application.ErrorCheckingOptions.NumberAsText=False
$book.Workbooks.OpenText($tmpfile2,Default,1,Default,1,False,True,False,False,False,False,"",$array, Default,Default,Default,True)
$book.ActiveSheet.Rows(1).Insert()
$book.ActiveSheet.Rows(1).Insert()
ProgressSet(75,"75 percent complete" & @CRLF & @CRLF & $file)
_ExcelWriteCell($book,"in machine datum : xm=-zb ; ym=-xb ; zm=yb with rotation (0.223deg)",1,1)
_ExcelWriteCell($book,"Xc",2,1)
_ExcelWriteCell($book,"Yc",2,2)
_ExcelWriteCell($book,"Zc",2,3)
_ExcelWriteCell($book,"i",2,4)
_ExcelWriteCell($book,"j",2,5)
_ExcelWriteCell($book,"k",2,6)
_ExcelWriteCell($book,"x+i",2,7)
_ExcelWriteCell($book,"y+j",2,8)
_ExcelWriteCell($book,"z+k",2,9)
_ExcelWriteCell($book,"scan line " & @CRLF & "number",2,10)
_ExcelHorizontalAlignSet($book,1,1,1,1,"center")
_ExcelHorizontalAlignSet($book,3,1,$lcount + 2,10,"right")
$book.Range($book.Cells(1,1),$book.Cells(1,10)).MergeCells=True
$book.Columns.AutoFit
ProgressSet(100,"100 percent complete" & @CRLF & @CRLF & $file)
$folder = FileSaveDialog("Save",@ScriptDir,"Excel (*.xlsx)",18)
ProgressOff()
If Not $folder Then ex($book,$tmpfile,$tmpfile2,"")
$book.ActiveWorkbook.SaveAs($folder,51,Default,Default,False,False,1,2)
ex($book,$tmpfile,$tmpfile2,$folder)
EndFunc

Func lcount($file)
If $file = "" Then Exit
Local $line
_FileReadToArray($file,$line)
For $i = UBound($line) - 1 To 0 Step -1
If $line[$i] = "" Then _ArrayDelete($line,$i)
Next
$line = UBound($line) - 1
parse($file,_TempFile(),_ExcelBookNew(1),$line)
EndFunc

Func ex($book,$tmpfile,$tmpfile2,$folder)
_ExcelBookClose($book,0)
Do
FileDelete($tmpfile)
FileDelete($tmpfile2)
Until Not FileExists($tmpfile) And Not FileExists($tmpfile2)
If Not $folder = "" Then MsgBox(0,"Conversion",'Apt Source conversion complete!!' & @CRLF & @CRLF & 'New file is located at: ' & $folder & ".xlsx")
Exit
EndFunc

lcount(FileOpenDialog("Open","","All(*.*)",3))
Edited by NickT

Share this post


Link to post
Share on other sites
water

Array in Array is not recommended. See the end of this page.

Function _ArrayDisplay doesn't know how to handle arrays in arrays.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
NickT

Okay, that's understandable. Is there a way to do this without an array in an array?

Share this post


Link to post
Share on other sites
water

Use a two-dimensional array. Something like this:

#include <Array.au3>
Global $Array[7][2]=[[0,2],[7,2],[41,2],[47,2],[61,1],[98,1],[99,1]]
_ArrayDisplay($Array)

BTW: Don't use "DIM", use "Global"


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
NickT

I tried that in my script but it doesn't work. I've also tried a 3-dimensional array as well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • VollachR
      By VollachR
      Hi,
      I'm looking for a way to take a number value from a Row2 of a 2D array and according to this check if files that appear in rows 3-11 in the array exists.
      For example, if the number in Row2 is 5 I need to check for the files in Row 3-6 only, if it is 6 than rows 3-7 and so on.
      I thought on using a FOR loop but I have very little experience with those.
      Can you suggest the best way to do what I need?
      BTW, the files in Rows 3-11 will usually have blank value for any row above the number in Row2 (e.g. Row2 = 5 so Rows3-6 will have values but 8-11 be empty), The values I need are in Column 1 of the array, the name of the key from the INI file that the array was created from is in Column 0.
      Full Example:
      Row2 of Array:
      Col0 = Games# - Col1 = 5
      Rows3-6
      Col0 = Exe2 - Col1 = Path To File
      Col0 = Exe3 - Col1 = Path To File
      Col0 = Exe4 - Col1 = Path To File
      Col0 = Exe5 - Col1 = Path To File
      I need that if Row2 is 5 to check these above for rows if the file exists, if it was 6 then the next row as well and so on up until number 10 in Row2 as it can't go above 10.
      So basically for whatever number in Row2 from 2-10 need to check 1-9 rows from 3-11 to see if the files in Col1 exists and if any of them don't exist it should call a function that shows an error message.
      I'm pretty sure I have the first line of the for look correct:
      For $i = 1 To $aAIO[2][1] Just not sure how to continue from there, also not sure if $i should be equal 1 or 2.
      Help will be appreciated.
    • FMS
      By FMS
      Hello,
      I'm trying to get data from twitter to an array and so far I found an Twitter UDF whish lookes very intresting but couldn't get it to work.
      It lookes not supported any more(2010) and buggy when i read all te replies.
      More around this subject (autoit and twitter) i couldn't find on this forum.
      Is there sombody who know's a good way to get live data from twitter to an array inside autoit?
      (I kinda doubt that this isn't tackled before)
      In the end I was hoping to get all tweets from date to date from an specific subject inside a 2D array to work whit.
    • AndreasNWWWWW
      By AndreasNWWWWW
      I got a question:  i am trying to run different functions based upon what i select in these radio buttons.(code below)
      it needs to check server 1. then run function 1 or function 2 after what i selected in the checkbox.
      once that function is done it moves to the next one, until it has been trough all 5 
       
      iv'e tried using while loops with different while $i equals to something but then i manualy need to go in and edit the script every time.
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) $Server2 = GUICtrlCreateLabel("Server2", 216, 95, 41, 17) $server1 = GUICtrlCreateLabel("Server1", 216, 72, 41, 17) $server4 = GUICtrlCreateLabel("Server4", 216, 144, 41, 17) $server3 = GUICtrlCreateLabel("Server3", 216, 119, 41, 17) $server5 = GUICtrlCreateLabel("Server5", 216, 170, 41, 17) $Start = GUICtrlCreateButton("Start", 240, 248, 147, 25) $Checkbox1 = GUICtrlCreateCheckbox("function1", 288, 72, 97, 17) $Checkbox2 = GUICtrlCreateCheckbox("function2", 392, 72, 97, 17) $Checkbox3 = GUICtrlCreateCheckbox("function1", 288, 96, 97, 17) $Checkbox4 = GUICtrlCreateCheckbox("function2", 392, 96, 97, 17) $Checkbox5 = GUICtrlCreateCheckbox("function1", 288, 120, 97, 17) $Checkbox6 = GUICtrlCreateCheckbox("function2", 392, 120, 97, 17) $Checkbox7 = GUICtrlCreateCheckbox("function1", 288, 144, 97, 17) $Checkbox8 = GUICtrlCreateCheckbox("function2", 392, 144, 97, 17) $Checkbox9 = GUICtrlCreateCheckbox("function1", 288, 170, 97, 17) $Checkbox10 = GUICtrlCreateCheckbox("function2", 392, 170, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd  
    • 31290
      By 31290
      Hi everyone, 
      I'm currently writing a script that allow me to list all currently installed software on a computer but some of the are listed in the HKLM64 hive of the registry whereas 95% of all others are in the HKLM "normal" one.
      Thing is, I'd like to combine these two reg key into one single ListView item.
      Here's my code so far, knowing that it's working on both cases (changing to HKLM64 or HKLM short)
      Thanks in advance for the help
      -31290-
    • Gowrisankar
      By Gowrisankar
      Dear members of the forum,
      I need to open excel files that may or may not need a password and finally move the files that needs password to manual queue.
      Is there a fastest way to do this?
       
      PS: I have a huge respect for the rules of this forum. I am not asking assistance to override any security measure. I just need to segregate the files that needs passwords.
×