how to remove multiple lines that starts/contains...

how to remove multiple lines that starts/contains...

4
NewbieNewbie
4

    May 27, 2005#1

    Hello. i'm new to UE.
    i'm converting html file to a txt file daily.
    so i was looking for tool that can do it automatically.
    let's say my source looks like this.

    <LINE TO REMOVE #1>
    5342 : EXAMPLE #1
    <tr><remove this line>
    <LINE TO REMOVE #3>
    6242 : EXAMPLE #2
    <tr><remove this line>
    <LINE TO REMOVE #4>
    6424 : EXAMPLE #3
    <tr><remove this line>


    i want to remove all of above lines.

    Rule #1 : remove lines that contains LINE TO REMOVE
    Rule #2 : remove lines that starts with numeric characters
    Rule #3 : remove lines that starts with <tr>

    is it possible?
    Thanks in advance

    63
    Advanced UserAdvanced User
    63

      May 27, 2005#2

      Hi r4bb1t

      Right off the top of my head there's a macro called
      HTML Strip Macros
      https://www.ultraedit.com/resources/macros/htmstrip.zip

      Maybe someone else has a better idea!

      4
      NewbieNewbie
      4

        May 27, 2005#3

        Hello MrBillG.
        Thanks for reply.

        i've tried that macro and it works a bit different with my needs
        i think this macro deletes everything between < >
        i need file locations of 'a href' links. it's not for me. :(
        but thank for your kindness MrBillG.

        any other comments would be appreciate.
        Thanks in advance.

        206
        MasterMaster
        206

          May 27, 2005#4

          Should be easy. Try this macro.

          InsertMode
          ColumnModeOff
          HexOff
          UnixReOn
          Top
          Find RegExp "^.*LINE TO REMOVE.*\p"
          Replace All ""
          Top
          Find RegExp "^[0-9].*\p"
          Replace All ""
          Top
          Find RegExp "^<tr>.*\p"
          Replace All ""
          Software For Metalworking
          http://closetolerancesoftware.com

          4
          NewbieNewbie
          4

            May 27, 2005#5

            Thanks for answer mrainey56.
            you were very helpful :)
            it's working as what i requested.
            but can i ask one more thing?
            after your macro, i got this result.

            | http://filelocation/is/here1.asp random text
            | http://filelocation/is/here2.asp r a n d o m text 2
            | http://filelocation/is/here3.asp ra nd om te xt 3

            I want to reformat these into..

            random text | http://filelocation/is/here1.asp
            r a n d o m text 2 | http://filelocation/is/here2.asp
            ra nd om te xt 3 | http://filelocation/is/here3.asp


            i have tried ^(|.*..asp) ^([a-z]) then replace ^2 ^1 but it's not working atm.
            first string grouped between | and .asp
            second string is random texts.(including numerics)
            can you point me what i'm wrong?
            Thank you very much

            206
            MasterMaster
            206

              May 27, 2005#6

              Try adding this to the end of the first macro:

              Top
              Find RegExp "^([|].*[.]asp)( )(.*)$"
              Replace All "\3 \1"


              I didn't work with your search/replace strings, but did notice that you were using Ultra Edit syntax for the tagged expressions, while I was in Unix mode.

              If you're going to switch modes inside a macro, make sure you first stick the appropriate line in your macro:

              UnixReOn

              or

              UnixReOff
              Software For Metalworking
              http://closetolerancesoftware.com

              4
              NewbieNewbie
              4

                May 28, 2005#7

                ahh
                i didn't realized that, mrainey56.
                however now it's working.
                you saved a lot of my time hehe

                Thank you very much.
                i got to learn more about UE.
                very useful :)