| View previous topic :: View next topic |
| Author |
Message |
weitzel78 Newbie

Joined: 30 Sep 2010 Posts: 1 Location: US
|
Posted: Thu Sep 30, 2010 6:54 am Post subject: Isolating Information from a URL in a Cell |
|
|
Here is what i need to do:
I have a list of a few thousand partial URLs that I want to reduce down to only the page number. I used find and replace to remove the first part of the URL, which was easy because they were all identical.
Now I can't figure out how to remove the rest.
I have:
123-corvette-c5-ls1-ls6-z06-97-04-high-flow-xo-style-crossover-pipe.aspx
82-dodge-challenger-srt8-61-corsa-sport-cat-back-exhaust.aspx
5689-flowmaster-outlaw-round-case-500-inout-15450.aspx
I want:
123
82
5689
From my research I need to use find and replace with regular expressions to select the part from the fist "-" to the end and then leave the replace with blank, thus deleting everything but the first numbers.
Is their an easier way to do this?
If not, what would the Regular Expression Code look like to select from the fist dash to the end?
Any help would be great, as I have been trying to do this for a few hours. |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8976 Location: Lexinton, Kentucky, USA
|
Posted: Thu Sep 30, 2010 7:55 am Post subject: |
|
|
Formula:
=LEFT(A1:FIND("-";A1)-1)
Find and Replace:
Search = (.[^-]*)-.*
Replace = $1
"(" and ")" define a series of characters.
"." = any character.
"[^-]" = other than a dash.
* = extend to other such characters.
"-.*" = followed by a dash and any series of characters.
$1 = the 1st defined series of characters. |
|
| Back to top |
|
 |
|