Jump to content
UBot Underground

Switch Rows With Columns?


Recommended Posts

Hi,

is there anyway to switch the table's row content with columns? or like, let's say i have a table with 40 rows and 8 columns, is there a way to make those rows columns & vice versa?

 

thanks!

Link to post
Share on other sites

I really don't think this is exactly what you are looking for but you can play with these and see...

 

Otherwise, you will need to loop through either column or row and increment the row/column index and place into a new table.

 

clear table(&row)
clear table(&row_newline)
clear table(&column_newline)
clear table(&column)
set(#list"A,B,C,D
r1a1,r1b1,r1c1,r1d1
r2a2,r2b2,r2c2,r2d2""Global")
add list to table as row(&row, 0, 0, $list from text(#list","))
add list to table as row(&row_newline, 0, 0, $list from text(#list$new line))
add list to table as column(&column, 0, 0, $list from text(#list","))
alert(&row_newline)
add list to table as column(&column_newline, 0, 0, $list from text(#list$new line))

Have fun!

 

CD

Link to post
Share on other sites

Hi,

is there anyway to switch the table's row content with columns? or like, let's say i have a table with 40 rows and 8 columns, is there a way to make those rows columns & vice versa?

 

thanks!

Sure. 

 

Loop through the old table and create a new one.

Innerloop for rows and outerloop for columns. 

 

loop (table total columns)

{

loop (table total rows) {

 

read each row 0 - xx from column 0 and write that to row 0 and column 0 - xxx in new table.

 

}

}

 

Cheers

Dan

Link to post
Share on other sites

Sure. 

 

Loop through the old table and create a new one.

Innerloop for rows and outerloop for columns. 

 

loop (table total columns)

{

loop (table total rows) {

 

read each row 0 - xx from column 0 and write that to row 0 and column 0 - xxx in new table.

 

}

}

 

Cheers

Dan

 

 

I really don't think this is exactly what you are looking for but you can play with these and see...

 

Otherwise, you will need to loop through either column or row and increment the row/column index and place into a new table.

 

clear table(&row)

clear table(&row_newline)

clear table(&column_newline)

clear table(&column)

set(#list"A,B,C,D

r1a1,r1b1,r1c1,r1d1

r2a2,r2b2,r2c2,r2d2""Global")

add list to table as row(&row, 0, 0, $list from text(#list","))

add list to table as row(&row_newline, 0, 0, $list from text(#list$new line))

add list to table as column(&column, 0, 0, $list from text(#list","))

alert(&row_newline)

add list to table as column(&column_newline, 0, 0, $list from text(#list$new line))

 

Have fun!

 

CD

 

 

thank you guys!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...