Delete only lines which start with a semicolon

Delete only lines which start with a semicolon

3
NewbieNewbie
3

    Nov 19, 2005#1

    I want to delete onliy lines in a file, which starts with a semicolon. e.g.:
    ; comment ...

    Lines which have a semicolon in the line like

    path=".;..\;"
    precision=14 ;comment ...

    should not be deleted!

    But my macro delete those lines although i use Find RegExp "^;"
    So does anybody know what is wrong? This is the macro:

    HexOff
    Top
    InsertMode
    Loop
    Find RegExp "^;"
    IfFound
    DeleteLine
    EndIf
    EndLoop

    206
    MasterMaster
    206

      Nov 19, 2005#2

      Maybe just try a regular expression search and replace (Unix mode)


      Find What: ^;.*\p
      Replace With:


      meaning, replace with nothing at all.
      Software For Metalworking
      http://closetolerancesoftware.com

      3
      NewbieNewbie
      3

        Nov 19, 2005#3

        Thanks for help - I tried it but, it does not work
        I thought it should be simple ... :?

        206
        MasterMaster
        206

          Nov 19, 2005#4

          It is simple. Try the same thing in macro form.


          InsertMode
          ColumnModeOff
          HexOff
          UnixReOn
          Top
          Find RegExp "^;.*\p"
          Replace All ""
          Software For Metalworking
          http://closetolerancesoftware.com

          3
          NewbieNewbie
          3

            Nov 19, 2005#5

            :) yes it works - thanks a lot ... greetings from Munich
            Stephan

            6,683583
            Grand MasterGrand Master
            6,683583

              Nov 20, 2005#6

              I guess, the single regular expression did not work, because your setting for regular expression was UltraEdit style. For UltraEdit style regular expression the search string is %;*^p.

              However, after running the macro from mrainey56, you now have activated Unix style regular expression. The macro commands UnixReOn or UnixReOff modifies this setting.
              For UltraEdit v11.10c and lower see Advanced - Configuration - Find - Unix style Regular Expressions.
              For UltraEdit v11.20 and higher see Advanced - Configuration - Searching - Unix style Regular Expressions.
              Best regards from an UC/UE/UES for Windows user from Austria