GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   I need advanced search and replace technique and short icq (https://gfy.com/showthread.php?t=413934)

Wolfy 01-08-2005 08:12 PM

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 01-08-2005 08:35 PM

not even a short icq?

Antonio 01-08-2005 08:41 PM

http://www.shemale.ws/hh/repl.jpg
you can replace any string in all the files (html etc) in the same folder

TonyL 01-08-2005 08:52 PM

HomeSite has a pretty decent advance replace as well.

-Tony

Wolfy 01-08-2005 08:53 PM

you showed me that the other night when I was looking for something different. How will this handle the wildcard strings?

Wolfy 01-08-2005 08:57 PM

downloading homesite now, thnaks.

Antonio 01-08-2005 09:16 PM

Wolfy I'm not sure I'm understanding exactly what you want to do :)
Anyway good luck. Hope the hosite does it for you.

Wolfy 01-08-2005 09:27 PM

"hosite" :winkwink: 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!

- Jesus Christ - 01-08-2005 09:32 PM

http://www.boolean.ca/replace/

extremely powerful replacement tool

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

rickholio 01-08-2005 09:39 PM

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. :upsidedow

- Jesus Christ - 01-08-2005 09:43 PM

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. :upsidedow

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.

rickholio 01-08-2005 10:04 PM

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. ;)

Wolfy 01-08-2005 10:06 PM

wow you guys are l33t.


thanks for the bk, cool program JC

- Jesus Christ - 01-08-2005 10:12 PM

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.

Webby 01-08-2005 10:16 PM

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.

rickholio 01-08-2005 10:17 PM

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? :helpme

- Jesus Christ - 01-08-2005 10:21 PM

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? :helpme

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.

Wolfy 01-08-2005 10:32 PM

JC, gettin down on the farm babeeeeee!

Antonio 01-08-2005 10:34 PM

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.

- Jesus Christ - 01-08-2005 10:38 PM

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.

rickholio 01-09-2005 02:00 AM

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? :disgust


All times are GMT -7. The time now is 08:47 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123