Johnno1980
New Member
- Joined
- Jul 27, 2011
- Messages
- 4
Hi All,
I have tried various ways and still finding problems so I hope you are able to assist. I currently have a new macro which pulls a text file. In turn adds various points to a leading track. The end points may have 1/2/3/4 different end points and inn turn the leading tracks may also vary in number. So each leading track will need to be multiplied for the amount of end points with their respective point added to the end . I hope the below view shows the original and output I am looking to achieve but unfortunately I am unable to come up with a solution and your great assistance will be hugely appreciated. Many thanks i advance all. Steve
[TABLE="width: 1209"]
<tbody>[TR]
[TD]Type[/TD]
[TD]Original Data[/TD]
[TD]End Waypoints Differ[/TD]
[TD]Output data should look like this[/TD]
[/TR]
[TR]
[TD]End Point 1[/TD]
[TD="align: left"]
<tbody>
</tbody>[/TD]
[TD]New End Point[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]SWANN.BROSS.J42.RBV.LLUND.BAYYS.PUT.[/TD]
[TD]TOPPS[/TD]
[TD]SWANN..BROSS.J42.RBV..LLUND..BAYYS..PUT TOPPS[/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]SWANN.BROSS.J42.RBV.LLUND.BAYYS.PUT.[/TD]
[TD]EBONY[/TD]
[TD]SWANN..BROSS.J42.RBV..LLUND..BAYYS..PUT EBONY[/TD]
[/TR]
[TR]
[TD]End Point 2[/TD]
[TD="align: left"]
<tbody>
</tbody>[/TD]
[TD]New End Point[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]SWANN.BROSS.J42.RBV.LLUND.BAYYS.PUT.WITCH.[/TD]
[TD]ALLEX[/TD]
[TD]SWANN..BROSS.J42.RBV..LLUND..BAYYS..PUT..WITCH ALLEX[/TD]
[/TR]
[TR]
[TD]End Point 3[/TD]
[TD="align: left"]
<tbody>
</tbody>[/TD]
[TD]New End Point[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]AGARD.SIE.J121.SHLEP.ACK.[/TD]
[TD]BRADD[/TD]
[TD]AGARD..SIE.J121.SHLEP..ACK BRADD[/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]AGARD.SIE.J121.SHLEP.ACK.[/TD]
[TD]KANNI[/TD]
[TD]AGARD..SIE.J121.SHLEP..ACK KANNI[/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]OR SWANN.BROSS.J42.RBV.ACK.[/TD]
[TD]BRADD[/TD]
[TD]OR SWANN..BROSS.J42.RBV..ACK BRADD[/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]OR SWANN.BROSS.J42.RBV.ACK.[/TD]
[TD]KANNI[/TD]
[TD]OR SWANN..BROSS.J42.RBV..ACK KANNI[/TD]
[/TR]
[TR]
[TD]End Point 4[/TD]
[TD="align: left"]
<tbody>
</tbody>[/TD]
[TD]New End Point[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]AGARD.SIE.J121.SHLEP.YAHOO.[/TD]
[TD]WHALE[/TD]
[TD]AGARD..SIE.J121.SHLEP..YAHOO WHALE[/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]OR SWANN.BROSS.J42.RBV.YAHOO.[/TD]
[TD]WHALE[/TD]
[TD]OR SWANN..BROSS.J42.RBV..YAHOO WHALE[/TD]
[/TR]
[TR]
[TD]End Point 5[/TD]
[TD="align: left"]
<tbody>
</tbody>[/TD]
[TD]New End Point[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]AGARD.SIE.B24.LYNUS.LARGE.[/TD]
[TD]DOVEY[/TD]
[TD]AGARD..SIE.B24.LYNUS..LARGE DOVEY
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 926"]
<tbody>[TR]
[TD]Each end point will have "OVER" followed by one end point or multiple devided with "/" this could be two/three/four different end points[/TD]
[/TR]
[TR]
[TD]With that in mind the leading track needs to be duplicated by the amount of times there are end points for the above "End Point"[/TD]
[/TR]
[TR]
[TD]The output I have on the right.[/TD]
[/TR]
[TR]
[TD]E.g End point 1 has 2 end points therefore I need to duplicate the leading track twice and add the two to the end.[/TD]
[/TR]
[TR]
[TD]E.g End point 3 has 2 end points but also has two leadinng tracks so each leading track needs to be duplicated and the end points added.[/TD]
[/TR]
[TR]
[TD]E.g End point 4 has one end point but 2 leading tracks therefore the end point "Whale" needs to be added to both.[/TD]
[/TR]
[TR]
[TD]I hope this makes sense and you can help me as I am at a loss now and it's the last piece in a huge puzzle.[/TD]
[/TR]
</tbody>[/TABLE]
I have tried various ways and still finding problems so I hope you are able to assist. I currently have a new macro which pulls a text file. In turn adds various points to a leading track. The end points may have 1/2/3/4 different end points and inn turn the leading tracks may also vary in number. So each leading track will need to be multiplied for the amount of end points with their respective point added to the end . I hope the below view shows the original and output I am looking to achieve but unfortunately I am unable to come up with a solution and your great assistance will be hugely appreciated. Many thanks i advance all. Steve
[TABLE="width: 1209"]
<tbody>[TR]
[TD]Type[/TD]
[TD]Original Data[/TD]
[TD]End Waypoints Differ[/TD]
[TD]Output data should look like this[/TD]
[/TR]
[TR]
[TD]End Point 1[/TD]
[TD="align: left"]
DC METRO DEPARTURES OVER TOPPS/EBONY PLEASE FILE: |
<tbody>
</tbody>
[TD]New End Point[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]SWANN.BROSS.J42.RBV.LLUND.BAYYS.PUT.[/TD]
[TD]TOPPS[/TD]
[TD]SWANN..BROSS.J42.RBV..LLUND..BAYYS..PUT TOPPS[/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]SWANN.BROSS.J42.RBV.LLUND.BAYYS.PUT.[/TD]
[TD]EBONY[/TD]
[TD]SWANN..BROSS.J42.RBV..LLUND..BAYYS..PUT EBONY[/TD]
[/TR]
[TR]
[TD]End Point 2[/TD]
[TD="align: left"]
DC METRO DEPARTURES OVER ALLEX PLEASE FILE: |
<tbody>
</tbody>
[TD]New End Point[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]SWANN.BROSS.J42.RBV.LLUND.BAYYS.PUT.WITCH.[/TD]
[TD]ALLEX[/TD]
[TD]SWANN..BROSS.J42.RBV..LLUND..BAYYS..PUT..WITCH ALLEX[/TD]
[/TR]
[TR]
[TD]End Point 3[/TD]
[TD="align: left"]
DC METRO DEPARTURES OVER BRADD/KANNI PLEASE FILE: |
<tbody>
</tbody>
[TD]New End Point[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]AGARD.SIE.J121.SHLEP.ACK.[/TD]
[TD]BRADD[/TD]
[TD]AGARD..SIE.J121.SHLEP..ACK BRADD[/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]AGARD.SIE.J121.SHLEP.ACK.[/TD]
[TD]KANNI[/TD]
[TD]AGARD..SIE.J121.SHLEP..ACK KANNI[/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]OR SWANN.BROSS.J42.RBV.ACK.[/TD]
[TD]BRADD[/TD]
[TD]OR SWANN..BROSS.J42.RBV..ACK BRADD[/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]OR SWANN.BROSS.J42.RBV.ACK.[/TD]
[TD]KANNI[/TD]
[TD]OR SWANN..BROSS.J42.RBV..ACK KANNI[/TD]
[/TR]
[TR]
[TD]End Point 4[/TD]
[TD="align: left"]
DC METRO DEPARTURES OVER WHALE PLEASE FILE: |
<tbody>
</tbody>
[TD]New End Point[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]AGARD.SIE.J121.SHLEP.YAHOO.[/TD]
[TD]WHALE[/TD]
[TD]AGARD..SIE.J121.SHLEP..YAHOO WHALE[/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]OR SWANN.BROSS.J42.RBV.YAHOO.[/TD]
[TD]WHALE[/TD]
[TD]OR SWANN..BROSS.J42.RBV..YAHOO WHALE[/TD]
[/TR]
[TR]
[TD]End Point 5[/TD]
[TD="align: left"]
DC METRO DEPARTURES OVER DOVEY PLEASE FILE: |
<tbody>
</tbody>
[TD]New End Point[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Leading track[/TD]
[TD]AGARD.SIE.B24.LYNUS.LARGE.[/TD]
[TD]DOVEY[/TD]
[TD]AGARD..SIE.B24.LYNUS..LARGE DOVEY
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 926"]
<tbody>[TR]
[TD]Each end point will have "OVER" followed by one end point or multiple devided with "/" this could be two/three/four different end points[/TD]
[/TR]
[TR]
[TD]With that in mind the leading track needs to be duplicated by the amount of times there are end points for the above "End Point"[/TD]
[/TR]
[TR]
[TD]The output I have on the right.[/TD]
[/TR]
[TR]
[TD]E.g End point 1 has 2 end points therefore I need to duplicate the leading track twice and add the two to the end.[/TD]
[/TR]
[TR]
[TD]E.g End point 3 has 2 end points but also has two leadinng tracks so each leading track needs to be duplicated and the end points added.[/TD]
[/TR]
[TR]
[TD]E.g End point 4 has one end point but 2 leading tracks therefore the end point "Whale" needs to be added to both.[/TD]
[/TR]
[TR]
[TD]I hope this makes sense and you can help me as I am at a loss now and it's the last piece in a huge puzzle.[/TD]
[/TR]
</tbody>[/TABLE]