Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-08-2005, 08:12 PM   #1
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
I need advanced search and replace technique and short icq

I want to replace all the <!---blah blah--->'s in my site - how do I do that besides a search replace with different amounts of wildcards?

I could do it one at a time, search and replace <!---*--->, <!---**--->, <!---***--->, etc - but that sucks donkeyballs.
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 08:35 PM   #2
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
not even a short icq?
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 08:41 PM   #3
Antonio
Too lazy to set a custom title
 
Antonio's Avatar
 
Join Date: Oct 2001
Location: Spartaaaaaaaaa
Posts: 14,136

you can replace any string in all the files (html etc) in the same folder
Antonio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 08:52 PM   #4
TonyL
Confirmed User
 
TonyL's Avatar
 
Join Date: Feb 2002
Location: "A measure of a man is his post count". Write that down.
Posts: 900
HomeSite has a pretty decent advance replace as well.

-Tony
TonyL is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 08:53 PM   #5
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
you showed me that the other night when I was looking for something different. How will this handle the wildcard strings?
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 08:57 PM   #6
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
downloading homesite now, thnaks.
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 09:16 PM   #7
Antonio
Too lazy to set a custom title
 
Antonio's Avatar
 
Join Date: Oct 2001
Location: Spartaaaaaaaaa
Posts: 14,136
Wolfy I'm not sure I'm understanding exactly what you want to do
Anyway good luck. Hope the hosite does it for you.
Antonio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 09:27 PM   #8
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
"hosite" doesn't look like it has what I want... I have a site that i want to find and replace a bunch of stuff in, and it all starts with "<!-----" and ends with "------>". A find and replace search with a wildcard (*) will not work because (*) only covers one character, I need something to handle multiplecharacters between two consistent variables ("<!---" and "--->"). I know there's a way to do this, help me people!
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 09:32 PM   #9
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
http://www.boolean.ca/replace/

extremely powerful replacement tool

One of my secret weapons. (well its not really a secret)
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 09:39 PM   #10
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
Shame you're not using some variety of unix... a simple regex would cover it:

sed 's/<!--.*blah.*-->/<!-- foo -->/g' < oldfile.html > newfile.html

Guess it's a little more complex in other OSes.
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 09:43 PM   #11
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
Quote:
Originally Posted by rickholio
Shame you're not using some variety of unix... a simple regex would cover it:

sed 's/<!--.*blah.*-->/<!-- foo -->/g' < oldfile.html > newfile.html

Guess it's a little more complex in other OSes.
Yes I love linux too, but lets not kid ourselves... having a graphical interface to do complicated string replacement makes things a lot easier.

Try using your method to replace a large paragraph of text using regular expressions and variables. its a lot less "complex" to do it with BK replace em.
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 10:04 PM   #12
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
Quote:
Originally Posted by - Jesus Christ -
Yes I love linux too, but lets not kid ourselves... having a graphical interface to do complicated string replacement makes things a lot easier.

Try using your method to replace a large paragraph of text using regular expressions and variables. its a lot less "complex" to do it with BK replace em.
I do complex search/replaces with regularity, but I suppose it comes down to which tools you're familiar with. Generally, graphical search/replace tools aren't readily available for *nix based machines simply because the commline tools have been around in essentially the same form for 20+ years and everyone knows them. ;)
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 10:06 PM   #13
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
wow you guys are l33t.


thanks for the bk, cool program JC
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 10:12 PM   #14
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
Quote:
Originally Posted by rickholio
I do complex search/replaces with regularity, but I suppose it comes down to which tools you're familiar with. Generally, graphical search/replace tools aren't readily available for *nix based machines simply because the commline tools have been around in essentially the same form for 20+ years and everyone knows them. ;)
You missed my point.

Command line tools CANT do some things BK can with regular expressions and multiple files. Not to mention saving replacement sets and settings to suit a specific website/project.
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 10:16 PM   #15
Webby
Too lazy to set a custom title
 
Join Date: Oct 2002
Location: Far far away - as possible
Posts: 14,956
Wolfy:

If the content is on a local drive... try CodeSwitcher.

This will trail thru sub dirs and replace simple or complete blocks of html code and replace it with whatever you want.
__________________
XXX TLD's - Another mosquito to swat.
Webby is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 10:17 PM   #16
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
I'm not sure I follow... I do advanced s/r's on multiple files all the time. Some simple shell scripting allows me to cycle through the files, rename for backup or put the new versions in a separate directory, etc. Something like the following:

mkdir newstuff
for a in *.php
do
sed 'some replacement string here' < $a > newstuff/$a
done

Or am I still missing your point?
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 10:21 PM   #17
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
Quote:
Originally Posted by rickholio
I'm not sure I follow... I do advanced s/r's on multiple files all the time. Some simple shell scripting allows me to cycle through the files, rename for backup or put the new versions in a separate directory, etc. Something like the following:

mkdir newstuff
for a in *.php
do
sed 'some replacement string here' < $a > newstuff/$a
done

Or am I still missing your point?
Yea becasue your hanging on to somthing becasue its old and it makes you feel cool to know unix.

You have never even used the software in question yet your gonna argue to the ends of the earth that you can do it with command line.

Your comment was "its more complex" with this software and its its not. (you can replace an UNLIMITED sized paragrah in as many files as you want without scripting... you were talking about command line replacemnt methods now your suddenly going into scripting somthing to do replacement)
So thump the unix bible elseware untill you actually try using the software your claiming your command line skills trump.
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 10:32 PM   #18
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
JC, gettin down on the farm babeeeeee!
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 10:34 PM   #19
Antonio
Too lazy to set a custom title
 
Antonio's Avatar
 
Join Date: Oct 2001
Location: Spartaaaaaaaaa
Posts: 14,136
Wolfy
The progr that I use uses regular expressions as well (as you can see from the screenshot) and can get the job done, but the one that JC recommended looks much easier to use - just downloaded it and I'm checking it out.
Antonio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-08-2005, 10:38 PM   #20
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
Actually handy File is easier to use but I like BK becasue it allows you to do more and arrange/save stuff in file sets.
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-09-2005, 02:00 AM   #21
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
Quote:
Originally Posted by - Jesus Christ -
Yea becasue your hanging on to somthing becasue its old and it makes you feel cool to know unix.

You have never even used the software in question yet your gonna argue to the ends of the earth that you can do it with command line.

Your comment was "its more complex" with this software and its its not. (you can replace an UNLIMITED sized paragrah in as many files as you want without scripting... you were talking about command line replacemnt methods now your suddenly going into scripting somthing to do replacement)
So thump the unix bible elseware untill you actually try using the software your claiming your command line skills trump.
Wow... what's with all the hate? All I said is that it possible to do simple replacements with a 1 liner, and possible to do complex multifile replacements with some simple scripting. I never claimed anything was 'superior' nor the task more 'complex', only that the tools to do the task aren't available out of the box and require additional software. That's hardly a barrier to task completion.

In fact quite explicitly said that whatever tool one is comfortable with is the one that'll be tapped to do the job. If the end result is that everything that needs to be searched and/or replaced gets done, then what's the difference aside from the comfort level of the person using it?

You have something against unix? Did a unix guru anally violate your mother or something?

Last edited by rickholio; 01-09-2005 at 02:02 AM..
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.