Jump to content

Retrieving the contents of an array and pasting the contents individually


Jzullo
 Share

Recommended Posts

Hello all, I'm new to this board and new to this AutoIt scripting. I have found this tool through college and really liked the possibilities this brings. I'm already trying to script something but I'm having a hard time in getting what I want done.

What I need to do is the following:

1. Export the contents of table to a text or Excel file

2. Import the contents into an array in AutoIt

3. Pick the contents of the array, one at a time, and copy it to the clipboard

4. Paste the contents of the clipboard in a specific input field in the other application

So far I was able to load the contents in an array using the array.au3, but I'm not being able to show the contents of the array one by one.

I really appreciate the help you guys can provide.

Link to comment
Share on other sites

Nahuel, really appreaciate your help! I'm already using it with a few tweaks and it's working just great. I'll have two columns with valuable information to copy to the clipboard. I'll search a little bit how to separate these two sets of information. Hopefully it'll work out great.

Link to comment
Share on other sites

Maybe this will help too?

#include <Array.au3>

Dim $MyArray[4][2]
;First column of the array
$MyArray[0][0]="Jhon"
$MyArray[1][0]="Jack"
$MyArray[2][0]="Carlos"
$MyArray[3][0]="Anna"

;Second column
$MyArray[0][1]="17"
$MyArray[1][1]="15"
$MyArray[2][1]="25"
$MyArray[3][1]="19"

$Info="";Where data will be saved to display

;"Sweep" rows
For $a=0 To UBound($MyArray,1)-1
    ;"Sweep" columns
    For $i=0 To UBound($MyArray,2)-1
        $Info=$MyArray[$a][$i] & "+" &$Info;Add row's first element + second element
    Next
    $Data=StringSplit($Info,"+");Split the string
    MsgBox(0,"","Name: "&$Data[2] & " Age: "&$Data[1]);Display info
    $Info="";Restart info variable
Next

;Display array as a table:
_ArrayDisplay($MyArray)

You should look at the _Array*() functions if you are gonna work a lot with arrays. It's usually easier for me.

Edited by Nahuel
Link to comment
Share on other sites

Nahuel, you're the man! <_<

This is a major jump start for me. I am trying to better understand these array functions, one of my main issues was how to copy what the array is pulling to the clipboard, one at a time, but now I'being able to do this.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...