How to delete many lines in one run?

How to delete many lines in one run?

2
NewbieNewbie
2

    Nov 14, 2004#1

    Hello,

    I'm often editing large files. I would like to delete many lines in one run.
    e.g. I have a text file with the following lines:

    A040 line1
    A040 line2
    A040 line3
    A050 line4
    A040 line5
    A040 line6
    etc

    I would like to delete the lines starting with A040, so in the "find what" textbox I fill in:
    ^A040.*$\n
    and in the "replace with" textbox:
    <nothing>

    And now the strange thing happens:
    If I click on "start" and then on "replace" (and keep clicking on "replace") all lines with A040 will be deleted.
    IF I click on "Replace All" about HALF of the lines will be deleted!

    So if I have a textfile with about 100.000 times an A040-line. UE tells me in the first run that about 50.000 lines are deleted; in the second run 25.000 - etc.

    How can I delete all the lines in ONE run?

    Is it a bug or am I doing something wrong?

    With kind regards,

    Rien

    6,616548
    Grand MasterGrand Master
    6,616548

      Nov 14, 2004#2

      This is a bug of Replace All. Executing the replace manually works. I know about this special problem since my first version of UE (V6.xx, I think), but I have not written a bug report about it, because I rarely need such a replace.

      The problem with Replace All occurs only, if the whole line should be deleted and the next line(s) also, because it fulfills the same search expression and the search expression starts with the symbol for start of line and ends with a line break symbol.

      As workaround, use A040.*$\n instead of ^A040.*$\n, if you are sure, that A040 only exists at start of line.

      Write a bug report mail to IDM with your example with a link to this forum post.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Jan 04, 2005#3

        Mmmmm,

        Strange.... they wrote me that it wasn't a bug.... But it's solved in 10.20d.

        Thanks a Lot!

        236
        MasterMaster
        236

          Jan 11, 2005#4

          In a similar vein:

          I tried a "replace all" to purge a number of CSV files of all occurences of a single "X" as a value which meant searching for ";X;" because all the values are separated by semicolons, and I didn't want it to delete any other "X"s than those that stand "by themselves".

          Replacing all ";X;" with ";;" didn't find all ";X;" if two were in a row (e.g., "123;4;X;3;X;X;321" would become "123;4;;3;;X;321"). Sounds like a typical "banana problem" (is there one "ana" or two in "banana"), but not a bug...

          Cheers,
          Tim