I was creating affiliate links but the urls that I was working with had tracking code added to the end with javascript. There were 40 links that looked like this:
http://www.headlineshirts.net/sharkula-t-shirt.html#.VmQs-Yl96Uk
I didn’t want to delete the code manually even though it wouldn’t take that much time. I wanted to remove the # and everything after it.
I was able to use this function in Google Sheets.
#.*
Select the calls you want to edit and use the Find and Replace feature and don’t forget to check “Search using regular expressions.”
You can see that I left the Replace with area empty. That is because I just wanted to remove text. But you could change the text this way if you wanted.
Paul Holy smokes this is awesome. Exactly what I was looking for. thank you so much!
Alan Watchorn Glad it could help.
Karen Thanks! I had a little trouble searching for ‘?’. Placed brackets around it like this [?].* and it worked. Saved me a lot of time.
Alan Watchorn Great. I had a similar issue. I think I did a search and replace with the ? to a # or something like that.
Naji Boutros It’s not working for me. I want to get rid of everything after a comma and space “, “. I’m putting in {, *} and it’s only removing the comma and the space.
What am I doing wrong?
Alan Watchorn You might have forgotten the period.
Try
, .*
instead of
, *
Brandon Woodson Just saved me the manual effort of removign parameters on a list of 58K URLs. THANK YOU!
Alan Watchorn You’re welcome. Glad it helped.
Jacob White Thank you! This is awesome. I used same method to remove characters before a comma ( .*, ) in ~400 records. Thanks again!
Alan Watchorn Great!
Trond Lepperød Thx, this worked fine!
Maryam Hmmm. I’t snot working for me. I’m trying to remove everything after a colon. For example,
“Auto & Transport:Auto Insurance”
Doing :.* and [:].* and neither is doing anything.
Alan Watchorn I have had some trouble depending on the character I am dealing with too. One possible solution is to do a search-replace on the colon (e.g. change : to #) and then try again using the idea above. I hope that helps.
Bruno Poulsen Thanks a lot! That worked. I wanted to remove everything after a “:” to clean up my SKUs for my webshop, so I just did a ctrl+H to get to the “find and replace” added :.* and it worked 🙂 Im a happy camper!
Regards
Bruno
Brandy Gamblin Incredible! Thank you!!
ewdwe Legend
Mike K Works great. Saved me lots of time. Thank you !
Alan Watchorn Great!
David Simpson Legend. Thanks, this worked a treat!
Alan Watchorn Glad it helped.
Kate This saved me huge time! Thank you!
Alan Watchorn Great! Me too!
Stuart Thank you!
Alan Watchorn You’re welcome!