Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automated Transposition

Hi,

I have a very long Excel spreadsheet, in excess of 13,000 rows,
generated from a network capture. The original datasheet has multiple
columns, but I’m only interested in two:

* Column G: which contains attributes, which are to become the column
headers in the new spreadsheet (e.g. length; timestamp; source address
etc.)

* Column I: which contains data (the variables) from each frame (e.g.
64; 000897; 10.10.0.4 etc.)

Manual transposition works, but is unfeasible for this amount of data,
I’ve seen various posts on automated transposition but I have an
additional issue in that each frame is an inconsistent total length.
That is Frame 01 would be transposed from A1:P1, but Frame 02 would go
from A2:AA2, which appears to be an issue for most VBScripts I’ve
seen. There is however some consistency in that the data I which to
use consistently runs for 46 rows, and the start of the next frame is
flagged by the start attribute “num”.

Therefore the attributes are transposed from Column G to row 1, only
once to form the headers.

IF Field = "frame.number"
THEN transpose to column A;

IF Field = "len"
THEN transpose to column B
AND rename "frame.length";

IF Field = "frame.time"
THEN transpose to column C;

Etc, etc.

And the variables are transposed under the relevant Attribute (e.g.
column header):

IF Field = "frame.number"
THEN transpose from column I to
column A row 2;
REPEAT for row 2 +n
UNTIL END;

IF Field = "len"
THEN transpose from column I to
column B row 2;
REPEAT for row 2 +n
UNTIL END;

IF Field = "frame.time"
THEN transpose from column I to
column C row 2;
REPEAT for row 2 +n
UNTIL END;

What I then end up with is a new spreadsheet that has:
frame.number frame.length frame.time Further
Attributes ........
1 60
000000000 ..........
2 64
000000002 ..........
3 62
000000004 ..........
Further variables
.......

Does anyone have any suggestions as to the best method to attack this
problem?

Thanks

Doug
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Automated Transposition

This will give you the column length for each column

for i =cells(1,columns.count).end(xlToLeft).count
lastrow=cells(rows.count,i).end(xlup).row
msgbox lastrow
next i
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Doug" wrote in message
...
Hi,

I have a very long Excel spreadsheet, in excess of 13,000 rows,
generated from a network capture. The original datasheet has multiple
columns, but I’m only interested in two:

* Column G: which contains attributes, which are to become the column
headers in the new spreadsheet (e.g. length; timestamp; source address
etc.)

* Column I: which contains data (the variables) from each frame (e.g.
64; 000897; 10.10.0.4 etc.)

Manual transposition works, but is unfeasible for this amount of data,
I’ve seen various posts on automated transposition but I have an
additional issue in that each frame is an inconsistent total length.
That is Frame 01 would be transposed from A1:P1, but Frame 02 would go
from A2:AA2, which appears to be an issue for most VBScripts I’ve
seen. There is however some consistency in that the data I which to
use consistently runs for 46 rows, and the start of the next frame is
flagged by the start attribute “num”.

Therefore the attributes are transposed from Column G to row 1, only
once to form the headers.

IF Field = "frame.number"
THEN transpose to column A;

IF Field = "len"
THEN transpose to column B
AND rename "frame.length";

IF Field = "frame.time"
THEN transpose to column C;

Etc, etc.

And the variables are transposed under the relevant Attribute (e.g.
column header):

IF Field = "frame.number"
THEN transpose from column I to
column A row 2;
REPEAT for row 2 +n
UNTIL END;

IF Field = "len"
THEN transpose from column I to
column B row 2;
REPEAT for row 2 +n
UNTIL END;

IF Field = "frame.time"
THEN transpose from column I to
column C row 2;
REPEAT for row 2 +n
UNTIL END;

What I then end up with is a new spreadsheet that has:
frame.number frame.length frame.time Further
Attributes ........
1 60
000000000 ..........
2 64
000000002 ..........
3 62
000000004 ..........
Further variables
.......

Does anyone have any suggestions as to the best method to attack this
problem?

Thanks

Doug

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Automated Transposition

for your need to get the last column
for i =cells(columns.count, "a").end(xlup).row
lastcol=cells(i,columns.count,i).end(xltoleft.row
msgbox lastcol
next i


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
This will give you the column length for each column

for i =cells(1,columns.count).end(xlToLeft).count
lastrow=cells(rows.count,i).end(xlup).row
msgbox lastrow
next i
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Doug" wrote in message
...
Hi,

I have a very long Excel spreadsheet, in excess of 13,000 rows,
generated from a network capture. The original datasheet has multiple
columns, but I’m only interested in two:

* Column G: which contains attributes, which are to become the column
headers in the new spreadsheet (e.g. length; timestamp; source address
etc.)

* Column I: which contains data (the variables) from each frame (e.g.
64; 000897; 10.10.0.4 etc.)

Manual transposition works, but is unfeasible for this amount of data,
I’ve seen various posts on automated transposition but I have an
additional issue in that each frame is an inconsistent total length.
That is Frame 01 would be transposed from A1:P1, but Frame 02 would go
from A2:AA2, which appears to be an issue for most VBScripts I’ve
seen. There is however some consistency in that the data I which to
use consistently runs for 46 rows, and the start of the next frame is
flagged by the start attribute “num”.

Therefore the attributes are transposed from Column G to row 1, only
once to form the headers.

IF Field = "frame.number"
THEN transpose to column A;

IF Field = "len"
THEN transpose to column B
AND rename "frame.length";

IF Field = "frame.time"
THEN transpose to column C;

Etc, etc.

And the variables are transposed under the relevant Attribute (e.g.
column header):

IF Field = "frame.number"
THEN transpose from column I to
column A row 2;
REPEAT for row 2 +n
UNTIL END;

IF Field = "len"
THEN transpose from column I to
column B row 2;
REPEAT for row 2 +n
UNTIL END;

IF Field = "frame.time"
THEN transpose from column I to
column C row 2;
REPEAT for row 2 +n
UNTIL END;

What I then end up with is a new spreadsheet that has:
frame.number frame.length frame.time Further
Attributes ........
1 60
000000000 ..........
2 64
000000002 ..........
3 62
000000004 ..........
Further variables
......

Does anyone have any suggestions as to the best method to attack this
problem?

Thanks

Doug


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Automated Transposition

for your need to get the last column
for i =cells(columns.count, "a").end(xlup).row
lastcol=cells(i,columns.count,i).end(xltoleft).col
msgbox lastcol
next i


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
for your need to get the last column
for i =cells(columns.count, "a").end(xlup).row
lastcol=cells(i,columns.count,i).end(xltoleft.row
msgbox lastcol
next i


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
This will give you the column length for each column

for i =cells(1,columns.count).end(xlToLeft).count
lastrow=cells(rows.count,i).end(xlup).row
msgbox lastrow
next i
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Doug" wrote in message
...
Hi,

I have a very long Excel spreadsheet, in excess of 13,000 rows,
generated from a network capture. The original datasheet has multiple
columns, but I’m only interested in two:

* Column G: which contains attributes, which are to become the column
headers in the new spreadsheet (e.g. length; timestamp; source address
etc.)

* Column I: which contains data (the variables) from each frame (e.g.
64; 000897; 10.10.0.4 etc.)

Manual transposition works, but is unfeasible for this amount of data,
I’ve seen various posts on automated transposition but I have an
additional issue in that each frame is an inconsistent total length.
That is Frame 01 would be transposed from A1:P1, but Frame 02 would go
from A2:AA2, which appears to be an issue for most VBScripts I’ve
seen. There is however some consistency in that the data I which to
use consistently runs for 46 rows, and the start of the next frame is
flagged by the start attribute “num”.

Therefore the attributes are transposed from Column G to row 1, only
once to form the headers.

IF Field = "frame.number"
THEN transpose to column A;

IF Field = "len"
THEN transpose to column B
AND rename "frame.length";

IF Field = "frame.time"
THEN transpose to column C;

Etc, etc.

And the variables are transposed under the relevant Attribute (e.g.
column header):

IF Field = "frame.number"
THEN transpose from column I to
column A row 2;
REPEAT for row 2 +n
UNTIL END;

IF Field = "len"
THEN transpose from column I to
column B row 2;
REPEAT for row 2 +n
UNTIL END;

IF Field = "frame.time"
THEN transpose from column I to
column C row 2;
REPEAT for row 2 +n
UNTIL END;

What I then end up with is a new spreadsheet that has:
frame.number frame.length frame.time Further
Attributes ........
1 60
000000000 ..........
2 64
000000002 ..........
3 62
000000004 ..........
Further variables
......

Does anyone have any suggestions as to the best method to attack this
problem?

Thanks

Doug



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex Transposition Leo Demarce Excel Discussion (Misc queries) 4 February 23rd 09 04:34 PM
Automating transposition exercise Bob Matthews[_2_] Excel Worksheet Functions 2 September 27th 08 04:19 AM
Transposition impossibility? Brisbane Rob Excel Discussion (Misc queries) 4 April 30th 06 09:03 PM
Transposition Kuna&Zagiel Excel Worksheet Functions 2 January 7th 05 12:06 PM
Transposition of data Ben.c Excel Programming 2 December 19th 03 01:21 PM


All times are GMT +1. The time now is 06:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"