No announcement yet.

Find / Replace with new line

  • Filter
  • Time
  • Show
Clear All
new posts

  • Find / Replace with new line

    Hi, is it possible to use Find / Replace to replace with a carriage return / line feed / newline character?

    Currently, for example, including "\n" in the Replace field just actually puts the characters "\n". Can it be escaped, or is there some other magic, to actually put in a new line?

    Tab (\t) works...

  • #2

    Unfortunately, BC3's Find dialog does not support going over multiple lines or finding the newline character specifically.
    Aaron P Scooter Software


    • #3

      Sorry, I initially misread your question. Our Find section does not support searching for the newline, but the Replace section does support using the Hex representation, such as:
      Aaron P Scooter Software


      • #4
        Sorry for the confusion, I did mean the "Replace" dialog, and specifically to "Replace with:" a newline character.

        Also I didn't mention it originally, but I'm primarily using the Linux version (on Fedora 17). And, if it matters, the text files are primarily Unix line endings, and UTF-8.

        I'm using BC3 v3.3.8 (build 16340).

        Unfortunately it does not appear to work at all in linux. It does however appear to work in the windows version (exact same version and build).

        Example of the result in linux:

        text: a,b,c,d,e
        Find: ,
        Replace with: \x0d
        result: ax0dbx0dcx0ddx0de

        I do have "Regular expression" checked, and have also tried to replace with a variety of other hex codes (including \x0a, and a few other hex codes for printable character), and the result is the same. Is this a bug or is it just me??

        (On a side note, the \x## replacement only appears to support the ASCII range... up to 7E..126, bug or intentional?)


        • #5
          BC for Linux uses a different, and more limited, regular expression engine than the Windows build. We're swapping that out for PCRE in version 4. One of our developers was working on it today, as a matter of fact.
          Zoë P Scooter Software