How to transpose rows and cells of a table 
Author Message
 How to transpose rows and cells of a table

Hello, the title tells my problem.
Im searching for a simple way to transpone the rows ans cells of a table.
Thank's


Sun, 02 May 2004 23:26:24 GMT  
 How to transpose rows and cells of a table

Quote:

>Hello, the title tells my problem.
>Im searching for a simple way to transpone the rows ans cells of a table.
>Thank's

Yes.

Use associative arrays indexed by NR to transpose rows, use fields
to transpose rows.

Give us some data and we'll give you a specific solution.

Chuck Demas

--
  Eat Healthy    |   _ _   | Nothing would be done at all,

  Die Anyway     |    v    | That no one could find fault with it.



Mon, 03 May 2004 02:52:51 GMT  
 How to transpose rows and cells of a table

Quote:

> Hello, the title tells my problem.
> Im searching for a simple way to transpone the rows ans cells of a table.
> Thank's

Depends on the size of the table.

If it's small enough to fit in memory, you can do
something like this (off the top of my head)
(assuming each table row is on a single line
and all rows have the same number of columns):

# save NF for the END and store the row
{nf=NF;for ( i=1; i<=NF; i++ ) a[NR, i] = $i}
# output by columns
END{for(i=1;i<=nf;i++)
    {for(j=1;j<=NR;j++)printf("%s ", a[j,i]);printf("\n")}

Quote:
}

If it won't fit in memory, it's harder:)

If it will fit, but the input is trickier, you might have to
change the code that stores each row.

Martin Cohen



Mon, 03 May 2004 02:56:18 GMT  
 How to transpose rows and cells of a table
On 14 Nov 2001 07:26:24 -0800,

Quote:

>Hello, the title tells my problem.
>Im searching for a simple way to transpone the rows ans cells of a table.
>Thank's

You may have missed :

Newsgroups: comp.lang.awk

From: Torfinn Ottesen
NNTP-Posting-Date: Thu, 08 Nov 2001 18:17:48 MET
Subject: Re: Records to fields and viceversa

This info should be enough to find it in Google
(where you are posting from, you were close !)

--
  (  Kees Nuyt; Rotterdam; Netherlands

c[_] Disclaimer: Any opinions etc. are mine, not necessarily my employer's.



Mon, 03 May 2004 04:43:24 GMT  
 How to transpose rows and cells of a table

Quote:


> > I'm searching for a simple way to ...

> ...

> Give us some data and we'll give you a specific solution.

Ah, hell! Just stay in bed! We'll send you our paychecks.

--
Jim Monty

Tempe, Arizona USA



Mon, 03 May 2004 10:38:15 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. alternate row color for every other row in table

2. How to transpose rows and columns???

3. Lookup to ODBC table repositions browse to 1st row in table

4. Table Widgets with Table and Row Adaptors

5. Selecting a row when clicking on a cell

6. TkTable cell, row and column determination from mouse position

7. TkTable- associate multiple tags with a cell/row/col

8. multiline cell on table

9. Table Widget cell locking problem -> Solved

10. Wierd error: table cells not locking

11. how to merge table cells

12. Adding data to a specific table cell

 

 
Powered by phpBB® Forum Software