Sign in to follow this  
Followers 0
Jewtus

Transpose array - I don't understand

4 posts in this topic

Hello everyone,

Please forgive me if this is a dumb question, I'm very new to autoit.

I'm trying to extract a table from a web portal and I have most of the script working.

Local $oTable = _IETableGetCollection($oIE, 1)
Local $aTableData = _IETableWriteToArray($oTable)

I tried writing the output to a file, which worked... sort of

Local $sFilePath = "C:\Automation\AutoIt\Example.csv"
_FileWriteFromArray($sFilePath, $aTableData, 1)

The file seems all sorts of messed up, so I tried using 

_ArrayDisplay($aTableData)

And that is when I figured out it was grabbing the table transposed. I have an output 7 rows 51 columns.

I've been trying to transpose them, but I'm not sure I understand the syntax.

Local $test [7][51] = _ArrayTranspose( ByRef $aTableData)
_ArrayDisplay($test)

Can someone steer me in the right direction? I'd like to ultimately output the file to CSV (or pipe it directly into SQLite) but I'm having some trouble figuring out how to actually transpose the data.

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi Jewtus

have you tried to use the "transpose" parameter directly in the _IETableWriteToArray() statement?

Local $oTable = _IETableGetCollection($oIE, 1)
Local $aTableData = _IETableWriteToArray($oTable, True) ; <-- add True here

also,

 if you want to use the _ArrayTranspose statement, you should use it like this:

_ArrayTranspose( $aTableData)
_ArrayDisplay($aTableData)
Edited by PincoPanco

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

 

Hi Jewtus

have you tried to use the "transpose" parameter directly in the _IETableWriteToArray() statement?

Local $oTable = _IETableGetCollection($oIE, 1)
Local $aTableData = _IETableWriteToArray($oTable, True) ; <-- add True here

tumblr_mba5psXab41r4t7nto1_250.gif

I didn't know that was even a thing... THANK YOU!!!

Share this post


Link to post
Share on other sites

You are welcome :)


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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  
Followers 0