Jump to content

Transpose array - I don't understand


Go to solution Solved by Gianni,

Recommended Posts

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.

 

Link to comment
Share on other sites

  • Solution

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

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

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

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...