Hi
I was hoping some excel whizz may be able to help me with this one. Ive been reading this forum for the last month or so and picked up lots of really useful tips that are making my work easier; thank very much!
So now i have a specific question of my own...
I have a text file with lots of data, i have pasted it into excel so i can manipulate it, and am hoping there may be a formula or macro that can make this process quicker..
Basically i am looking to delete certain parts of the text. I cant really explain properly so i have provided an example of the text below:
sample of four lines, ive just pasted them straight into excel so each line falls within 1 cell (i could delimit but the data varies and they can contain more or less data).
<TABLE style="WIDTH: 1216pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=1621><COLGROUP><COL style="WIDTH: 1216pt; mso-width-source: userset; mso-width-alt: 59282" width=1621><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 1216pt; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20 width=1621>link 2991 2992 category 11 speed 30 mph force merge force across cost factor 0.800 junction visibility 30.00 m gap acceptance lane merge 2.00 gap acceptance lane cross 2.00 gap acceptance path cross 2.00 arc centre #5060 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3152 3179 category 11 speed 20 mph width 8.6 m force merge force across gap acceptance look next arc centre #5410 </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3219 3264 category 11 speed 20 mph width 8.6 m force merge force across junction visibility 30.00 m gap acceptance lane merge 0.00 gap acceptance lane cross 0.00 arc centre #5346 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3222 3221 category 11 speed 25 mph force merge force across junction visibility 40.00 m gap acceptance lane merge 0.50 gap acceptance lane cross 0.50 arc centre #1828 left </TD></TR></TBODY></TABLE>
I am looking to remove any text that says the following:
"gap acceptance lane merge x.xx"
"gap acceptance lane cross x.xx"
"gap acceptance path cross x.xx"
I would use a find replace but the numbers proceeding the text vary. Additionally, there is another phrase often contained that included the text "gap acceptance" (i,e, gap acceptance look next) which i do not want to remove.
So the lines above would be converted to the following:
<TABLE style="WIDTH: 1216pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=1621><COLGROUP><COL style="WIDTH: 1216pt; mso-width-source: userset; mso-width-alt: 59282" width=1621><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 1216pt; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20 width=1621>link 2991 2992 category 11 speed 30 mph force merge force across cost factor 0.800 junction visibility 30.00 m arc centre #5060 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3152 3179 category 11 speed 20 mph width 8.6 m force merge force across gap acceptance look next arc centre #5410 </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3219 3264 category 11 speed 20 mph width 8.6 m force merge force across junction visibility 30.00 m arc centre #5346 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3222 3221 category 11 speed 25 mph force merge force across junction visibility 40.00 m arc centre #1828 left </TD></TR></TBODY></TABLE>
The second part to my problem is that i am looking to replace any text that reads "junction visibility X.xx m" with "junction visibility 20.00 m" i.e. all junction visibility should be set at 20 m so in the four lines would then read..
<TABLE style="WIDTH: 1216pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=1621><COLGROUP><COL style="WIDTH: 1216pt; mso-width-source: userset; mso-width-alt: 59282" width=1621><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 1216pt; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20 width=1621>link 2991 2992 category 11 speed 30 mph force merge force across cost factor 0.800 junction visibility 20.00 m arc centre #5060 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3152 3179 category 11 speed 20 mph width 8.6 m force merge force across gap acceptance look next arc centre #5410 </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3219 3264 category 11 speed 20 mph width 8.6 m force merge force across junction visibility 20.00 m arc centre #5346 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3222 3221 category 11 speed 25 mph force merge force across junction visibility 20.00 m arc centre #1828 left </TD></TR></TBODY></TABLE>
Any help would be much appreciated. And appologies if this is a stupid question
Stuart
I was hoping some excel whizz may be able to help me with this one. Ive been reading this forum for the last month or so and picked up lots of really useful tips that are making my work easier; thank very much!
So now i have a specific question of my own...
I have a text file with lots of data, i have pasted it into excel so i can manipulate it, and am hoping there may be a formula or macro that can make this process quicker..
Basically i am looking to delete certain parts of the text. I cant really explain properly so i have provided an example of the text below:
sample of four lines, ive just pasted them straight into excel so each line falls within 1 cell (i could delimit but the data varies and they can contain more or less data).
<TABLE style="WIDTH: 1216pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=1621><COLGROUP><COL style="WIDTH: 1216pt; mso-width-source: userset; mso-width-alt: 59282" width=1621><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 1216pt; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20 width=1621>link 2991 2992 category 11 speed 30 mph force merge force across cost factor 0.800 junction visibility 30.00 m gap acceptance lane merge 2.00 gap acceptance lane cross 2.00 gap acceptance path cross 2.00 arc centre #5060 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3152 3179 category 11 speed 20 mph width 8.6 m force merge force across gap acceptance look next arc centre #5410 </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3219 3264 category 11 speed 20 mph width 8.6 m force merge force across junction visibility 30.00 m gap acceptance lane merge 0.00 gap acceptance lane cross 0.00 arc centre #5346 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3222 3221 category 11 speed 25 mph force merge force across junction visibility 40.00 m gap acceptance lane merge 0.50 gap acceptance lane cross 0.50 arc centre #1828 left </TD></TR></TBODY></TABLE>
I am looking to remove any text that says the following:
"gap acceptance lane merge x.xx"
"gap acceptance lane cross x.xx"
"gap acceptance path cross x.xx"
I would use a find replace but the numbers proceeding the text vary. Additionally, there is another phrase often contained that included the text "gap acceptance" (i,e, gap acceptance look next) which i do not want to remove.
So the lines above would be converted to the following:
<TABLE style="WIDTH: 1216pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=1621><COLGROUP><COL style="WIDTH: 1216pt; mso-width-source: userset; mso-width-alt: 59282" width=1621><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 1216pt; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20 width=1621>link 2991 2992 category 11 speed 30 mph force merge force across cost factor 0.800 junction visibility 30.00 m arc centre #5060 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3152 3179 category 11 speed 20 mph width 8.6 m force merge force across gap acceptance look next arc centre #5410 </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3219 3264 category 11 speed 20 mph width 8.6 m force merge force across junction visibility 30.00 m arc centre #5346 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3222 3221 category 11 speed 25 mph force merge force across junction visibility 40.00 m arc centre #1828 left </TD></TR></TBODY></TABLE>
The second part to my problem is that i am looking to replace any text that reads "junction visibility X.xx m" with "junction visibility 20.00 m" i.e. all junction visibility should be set at 20 m so in the four lines would then read..
<TABLE style="WIDTH: 1216pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=1621><COLGROUP><COL style="WIDTH: 1216pt; mso-width-source: userset; mso-width-alt: 59282" width=1621><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 1216pt; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20 width=1621>link 2991 2992 category 11 speed 30 mph force merge force across cost factor 0.800 junction visibility 20.00 m arc centre #5060 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3152 3179 category 11 speed 20 mph width 8.6 m force merge force across gap acceptance look next arc centre #5410 </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3219 3264 category 11 speed 20 mph width 8.6 m force merge force across junction visibility 20.00 m arc centre #5346 left </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" height=20>link 3222 3221 category 11 speed 25 mph force merge force across junction visibility 20.00 m arc centre #1828 left </TD></TR></TBODY></TABLE>
Any help would be much appreciated. And appologies if this is a stupid question
Stuart