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)
-   -   anyone know of a search and replace program that can do this? (https://gfy.com/showthread.php?t=595358)

chodadog 04-07-2006 03:32 AM

anyone know of a search and replace program that can do this?
 
Say i hvae the following lines in a text file:

[blahblah]code[/blahblahblah]
[asdfasfewfaf]code[/asasdfafdsfaf]
[asdfasfweradvdsfafsadf]code[/asdfajsfoiwuasfdasdf]

Is there a program where i can say i want code replaced with code$ where the $ is a count? so the result would be:


[blahblah]code1[/blahblahblah]
[asdfasfewfaf]code2[/asasdfafdsfaf]
[asdfasfweradvdsfafsadf]code3[/asdfajsfoiwuasfdasdf]

?

SmokeyTheBear 04-07-2006 03:35 AM

cant you just replace "[/" with "1[/"

SmokeyTheBear 04-07-2006 03:35 AM

oh whoops i get ya , never mind..

mOrrI 04-07-2006 03:37 AM

Can allways a program to do that ... :)

chodadog 04-07-2006 03:43 AM

It's nothing major. Will just save me a few hours of repetitive work.

SmokeyTheBear 04-07-2006 03:45 AM

ok i just made a little tool to do that , are those the specific characters you want to do ?

chodadog 04-07-2006 03:48 AM

Actually, this is what i'll need to replace:

<td align="center"><?=$thumb?></TD>
<td align="center"><?=$thumb?></TD>
<td align="center"><?=$thumb?></TD>
<td align="center"><?=$thumb?></TD>
<td align="center"><?=$thumb?></TD>

with the <?=$thumb?> bit to be replaced with <?-$thumb1?> for example

so perhaps using the $ as the replacement code in my original post wasn't the best idea. hehe.

darksoul 04-07-2006 04:41 AM

Code:

perl -e 'while(<>) {$i++; $_ =~ s/thumb/thumb$i/g;print;}' < file.html

jimthefiend 04-07-2006 04:46 AM

Arliss maybe?


All times are GMT -7. The time now is 04:27 AM.

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