OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Isolating Information from a URL in a Cell

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
weitzel78
Newbie
Newbie


Joined: 30 Sep 2010
Posts: 1
Location: US

PostPosted: Thu Sep 30, 2010 6:54 am    Post subject: Isolating Information from a URL in a Cell Reply with quote

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
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 8976
Location: Lexinton, Kentucky, USA

PostPosted: Thu Sep 30, 2010 7:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group