anyone know of a search and replace program that can do this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chodadog
    Confirmed User
    • Apr 2002
    • 9736

    #1

    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]

    ?
    26 + 6 = 1
  • SmokeyTheBear
    ►SouthOfHeaven
    • Jun 2004
    • 28609

    #2
    cant you just replace "[/" with "1[/"
    hatisblack at yahoo.com

    Comment

    • SmokeyTheBear
      ►SouthOfHeaven
      • Jun 2004
      • 28609

      #3
      oh whoops i get ya , never mind..
      hatisblack at yahoo.com

      Comment

      • mOrrI
        It's over there...
        • Nov 2004
        • 4208

        #4
        Can allways a program to do that ...

        Comment

        • chodadog
          Confirmed User
          • Apr 2002
          • 9736

          #5
          It's nothing major. Will just save me a few hours of repetitive work.
          26 + 6 = 1

          Comment

          • SmokeyTheBear
            ►SouthOfHeaven
            • Jun 2004
            • 28609

            #6
            ok i just made a little tool to do that , are those the specific characters you want to do ?
            hatisblack at yahoo.com

            Comment

            • chodadog
              Confirmed User
              • Apr 2002
              • 9736

              #7
              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.
              26 + 6 = 1

              Comment

              • darksoul
                Confirmed User
                • Apr 2002
                • 4997

                #8
                Code:
                perl -e 'while(<>) {$i++; $_ =~ s/thumb/thumb$i/g;print;}' < file.html
                1337 5y54|)m1n: 157717888
                BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                Cambooth

                Comment

                • jimthefiend
                  So Fucking Banned
                  • Oct 2003
                  • 18889

                  #9
                  Arliss maybe?

                  Comment

                  Working...