Hi, similar question to OP:
Hello all, I have a similar question to the OP. My data looks as follows:
<table x:str="" style="border-collapse: collapse; width: 436pt;" border="0" cellpadding="0" cellspacing="0" width="581"><col style="width: 156pt;" width="208"> <col style="width: 149pt;" width="199"> <col style="width: 131pt;" width="174"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl22" style="height: 12.75pt; width: 156pt;" width="208" height="17">
Object Type</td> <td class="xl22" style="width: 149pt;" width="199">
Object Properties</td> <td class="xl22" style="width: 131pt;" width="174">
Property Values</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">GSR_DIPD01</td> <td class="xl23">
</td> <td class="xl23">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::Inverted</td> <td class="xl23" x:bool="TRUE" x:fmla="= TRUE">TRUE</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::ObjectName</td> <td class="xl23" x:fmla="= "942-HS____-1001_"">942-HS____-1001_</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::DisturbanceUsed</td> <td class="xl23" x:bool="FALSE" x:fmla="= FALSE">FALSE</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::CycleTime</td> <td class="xl23" x:fmla="= "3s"">3s</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::LabelFont</td> <td class="xl23" x:fmla="= "FC30"">FC30</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::OffColor</td> <td class="xl23" x:fmla="= "L5"">L5</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::LabelOffColor</td> <td class="xl23" x:fmla="= "A1"">A1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::LabelColor</td> <td class="xl23" x:fmla="= "A1"">A1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::LabelOff</td> <td class="xl23" x:fmla="= "ON"">ON</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::ProcessDialog</td> <td class="xl23" x:fmla="= "dcDiButtonDialog"">dcDiButtonDialog</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::LabelOn</td> <td class="xl23" x:fmla="= "ON"">ON</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">GSR_DIPD01</td> <td class="xl23">
</td> <td class="xl23">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::Inverted</td> <td class="xl23" x:bool="TRUE" x:fmla="= TRUE">TRUE</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::ObjectName</td> <td class="xl23" x:fmla="= "942-HS____-1002_"">942-HS____-1002_</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::DisturbanceUsed</td> <td class="xl23" x:bool="FALSE" x:fmla="= FALSE">FALSE</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::CycleTime</td> <td class="xl23" x:fmla="= "3s"">3s</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::LabelFont</td> <td class="xl23" x:fmla="= "FC30"">FC30</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::OffColor</td> <td class="xl23" x:fmla="= "L5"">L5</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::LabelOffColor</td> <td class="xl23" x:fmla="= "A1"">A1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::LabelColor</td> <td class="xl23" x:fmla="= "A1"">A1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::LabelOff</td> <td class="xl23" x:fmla="= "ON"">ON</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::ProcessDialog</td> <td class="xl23" x:fmla="= "dcDiButtonDialog"">dcDiButtonDialog</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::LabelOn</td> <td class="xl23" x:fmla="= "ON"">ON</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">AIEPD07</td> <td class="xl23">
</td> <td class="xl23">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::ConditionCycle</td> <td class="xl23" x:fmla="= "onRequest+onEvent"">onRequest+onEvent</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::ObjectName</td> <td class="xl23" x:fmla="= "942-PT____-1009_"">942-PT____-1009_</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::BackgroundColor</td> <td class="xl23" x:fmla="= "E10"">E10</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">
</td> <td class="xl23">ports::ButtonText</td> <td class="xl23" x:str="" x:fmla="= """>BLUE
</td> </tr> </tbody></table>
The first column contains "object types" and the second and third columns contain properties of those objects. The number of properties varies for each object. The properties begin one cell right and down from the object types. The next object is then one cell down and left of the last property of the previous object.
What I'm trying to do is transpose the properties data for each object type to the row containing the object type. The names of the properties (example ports::inverted) would be the column headers. The property values (example TRUE) would be the data. The rows that used to contain the properties should be deleted. This is the easy bit and I'm not sure how to do it
I think the difficult bit is what comes next. For the first object type, all the properties would become new column headers. For the second object type, the function would have to look to see what column headers (what properties) already exist and only create new ones
ONLY if required.
So my final result would look something like this (hopefully this works):
<table x:str="" style="border-collapse: collapse; width: 1575pt;" border="0" cellpadding="0" cellspacing="0" width="2095"><col style="width: 64pt;" width="85"> <col style="width: 75pt;" width="100"> <col style="width: 119pt;" width="158"> <col style="width: 101pt;" width="134"> <col style="width: 71pt;" width="94"> <col style="width: 92pt;" width="122"> <col style="width: 113pt;" width="151"> <col style="width: 83pt;" width="111"> <col style="width: 81pt;" width="108"> <col style="width: 76pt;" width="101"> <col style="width: 101pt;" width="134"> <col style="width: 86pt;" width="114"> <col style="width: 74pt;" width="98"> <col style="width: 105pt;" width="140"> <col style="width: 73pt;" width="97"> <col style="width: 87pt;" span="3" width="116"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl22" style="height: 12.75pt; width: 64pt;" width="85" height="17">File Name</td> <td class="xl22" style="width: 75pt;" width="100">Object Type</td> <td class="xl22" style="width: 119pt;" width="158">Object Properties</td> <td class="xl22" style="width: 101pt;" width="134">Property Values</td> <td class="xl23" style="width: 71pt;" width="94">ports::Inverted</td> <td class="xl23" style="width: 92pt;" width="122">ports::ObjectName</td> <td class="xl23" style="width: 113pt;" width="151">ports::DisturbanceUsed</td> <td class="xl23" style="width: 83pt;" width="111">ports::CycleTime</td> <td class="xl23" style="width: 81pt;" width="108">ports::LabelFont</td> <td class="xl23" style="width: 76pt;" width="101">ports::OffColor</td> <td class="xl23" style="width: 101pt;" width="134">ports::LabelOffColor</td> <td class="xl23" style="width: 86pt;" width="114">ports::LabelColor</td> <td class="xl23" style="width: 74pt;" width="98">ports::LabelOff</td> <td class="xl23" style="width: 105pt;" width="140">ports::ProcessDialog</td> <td class="xl23" style="width: 73pt;" width="97">ports::LabelOn</td> <td class="xl23" style="width: 87pt;" width="116">ports::ConditionCycle</td> <td class="xl23" style="width: 87pt;" width="116">ports::BackgroundColor</td> <td class="xl23" style="width: 87pt;" width="116">ports::ButtonText</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">942A.ds:</td> <td class="xl23">GSR_DIPD01</td> <td class="xl23">
</td> <td class="xl23">
</td> <td class="xl23" x:bool="TRUE" x:fmla="= TRUE">TRUE</td> <td class="xl23" x:fmla="= "942-HS____-1001_"">942-HS____-1001_</td> <td class="xl23" x:bool="FALSE" x:fmla="= FALSE">FALSE</td> <td class="xl23" x:fmla="= "3s"">3s</td> <td class="xl23" x:fmla="= "FC30"">FC30</td> <td class="xl23" x:fmla="= "L5"">L5</td> <td class="xl23" x:fmla="= "A1"">A1</td> <td class="xl23" x:fmla="= "A1"">A1</td> <td class="xl23" x:fmla="= "ON"">ON</td> <td class="xl23" x:fmla="= "dcDiButtonDialog"">dcDiButtonDialog</td> <td class="xl23" x:fmla="= "ON"">ON</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">942A.ds:</td> <td class="xl23">GSR_DIPD01</td> <td class="xl23">
</td> <td class="xl23">
</td> <td class="xl23" x:bool="TRUE" x:fmla="= TRUE">TRUE</td> <td class="xl23" x:fmla="= "942-HS____-1002_"">942-HS____-1002_</td> <td class="xl23" x:bool="FALSE" x:fmla="= FALSE">FALSE</td> <td class="xl23" x:fmla="= "3s"">3s</td> <td class="xl23" x:fmla="= "FC30"">FC30</td> <td class="xl23" x:fmla="= "L5"">L5</td> <td class="xl23" x:fmla="= "A1"">A1</td> <td class="xl23" x:fmla="= "A1"">A1</td> <td class="xl23" x:fmla="= "ON"">ON</td> <td class="xl23" x:fmla="= "dcDiButtonDialog"">dcDiButtonDialog</td> <td class="xl23" x:fmla="= "ON"">ON</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl23" style="height: 12.75pt;" height="17">942A.ds:</td> <td class="xl23">AIEPD07</td> <td class="xl23">
</td> <td class="xl23">
</td> <td>
</td> <td class="xl23" x:fmla="= "942-PT____-1009_"">942-PT____-1009_</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td class="xl23" x:fmla="= "onRequest+onEvent"">onRequest+onEvent</td> <td class="xl23" x:fmla="= "E10"">E10</td> <td>BLUE</td> </tr> </tbody></table>
Hopefully somebody can help! Thank you!!!!