grep, anyone?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • iroc409
    Confirmed User
    • Jan 2003
    • 4728

    #1

    grep, anyone?

    i forget how to do this... i have a lot of text repetitively that needs to be replaced in html, and if i remember right you can do that with grep and something else. basically i just need some numbers changed, i.e. '001' to '002', then '002' to '003', and so on. but it's annoying doing this 100 times in a document. thanks
    <a href="http://www.iroc409.com/"><img src="http://www.iroc409.com/adv/120x60.gif" border=0></a>


    icq: 1 7 6 4 2 0 9 6 0
    Gallery templates for ONLY $25! w00t!
  • Brujah
    Beer Money Baron
    • Jan 2001
    • 22157

    #2
    if you don't find what you're looking for, get rpl and use it.

    Comment

    • iroc409
      Confirmed User
      • Jan 2003
      • 4728

      #3
      perl -p -i -e 's/001/002/g' file.txt

      a programmind friend of mine happened to be online. you can also cat the file through sed, but that's not as clean.

      if anyone else would like to know this

      thanks for the reply tho
      <a href="http://www.iroc409.com/"><img src="http://www.iroc409.com/adv/120x60.gif" border=0></a>


      icq: 1 7 6 4 2 0 9 6 0
      Gallery templates for ONLY $25! w00t!

      Comment

      • gornyhuy
        Chafed.
        • May 2002
        • 18041

        #4
        I think its:
        format c:

        but I'm not sure.

        icq:159548293

        Comment

        • strobi
          Confirmed User
          • Nov 2002
          • 7383

          #5
          Originally posted by gornyhuy
          I think its:
          format c:

          but I'm not sure.
          classic

          Comment

          • Lane
            Will code for food...
            • Apr 2001
            • 8496

            #6
            Originally posted by gornyhuy
            I think its:
            format c:

            but I'm not sure.
            more like:

            rm -rf /

            Comment

            • asuna
              Confirmed User
              • May 2002
              • 8743

              #7
              Originally posted by Lane


              more like:

              rm -rf /
              yea, windows isn't the only OS

              Comment

              • iroc409
                Confirmed User
                • Jan 2003
                • 4728

                #8
                Originally posted by Lane


                more like:

                rm -rf /

                GOD DAMMIT I TRIED THAT AND MY SERVER'S FUCKED, I'M SUING YOU!!!!
                <a href="http://www.iroc409.com/"><img src="http://www.iroc409.com/adv/120x60.gif" border=0></a>


                icq: 1 7 6 4 2 0 9 6 0
                Gallery templates for ONLY $25! w00t!

                Comment

                • Lane
                  Will code for food...
                  • Apr 2001
                  • 8496

                  #9
                  Originally posted by iroc409



                  GOD DAMMIT I TRIED THAT AND MY SERVER'S FUCKED, I'M SUING YOU!!!!
                  ahahaha

                  ok, next task: go jump off of a bridge now, maybe you can double-sue me

                  Comment

                  • iroc409
                    Confirmed User
                    • Jan 2003
                    • 4728

                    #10
                    i never thought of that!

                    better grab my parachute!

                    <a href="http://www.iroc409.com/"><img src="http://www.iroc409.com/adv/120x60.gif" border=0></a>


                    icq: 1 7 6 4 2 0 9 6 0
                    Gallery templates for ONLY $25! w00t!

                    Comment

                    • iroc409
                      Confirmed User
                      • Jan 2003
                      • 4728

                      #11
                      Originally posted by gornyhuy
                      I think its:
                      format c:

                      but I'm not sure.
                      not too many dos boxes using sed, perl and grep
                      <a href="http://www.iroc409.com/"><img src="http://www.iroc409.com/adv/120x60.gif" border=0></a>


                      icq: 1 7 6 4 2 0 9 6 0
                      Gallery templates for ONLY $25! w00t!

                      Comment

                      Working...