Loading ...
Sorry, an error occurred while loading the content.

405RE: [NTS] Changing CR & LF

Expand Messages
  • John Shotsky
    Jun 1, 2008
    • 0 Attachment
      I use Regex expressions quite a bit, and line terminations are an issue I deal with a lot.

      NoteTab considers \R to be any combination of line terminators.
      \n is just the line feed.

      So, I convert as follows:
      ^!Replace "\R" >> "\n" ARSTW

      This converts any kind of terminator to a line feed. I do this because I perform a lot of operations with clips on text,
      so \n is my preferred 'holding' format.

      When I exit the clips, I convert back to standard Windows text format:

      ^!Replace "\n" >> "^%NL%" ARSTW

      John

      From: ntb-scripts@yahoogroups.com [mailto:ntb-scripts@yahoogroups.com] On Behalf Of loro
      Sent: Sunday, June 01, 2008 1:36 PM
      To: ntb-scripts@yahoogroups.com
      Subject: Re: [NTS] Changing CR & LF

      Art Kocsis wrote:
      >I am trying to make a small clip efficient by using RegEx but am getting
      >nowhere.
      >
      >What I am trying to do is convert any text file (Unix or Windows) to a
      >single spaced
      >windows file, i.e., one using CRLF as a line terminator.
      >
      >My plan was to change all LFs (0Ah), to CRs (0Dh), and then collapse all
      >single and multiple CRs
      >to a single NL (0D0Ah).
      >
      > ^!Replace /l+ >> /r TIWR
      > ^!Replace /r+ >> /n TIWR
      >or
      > ^!Replace /r+ >> /l R
      > ^!Replace /l+ >> /n R
      >
      >However, this does not work as NoteTab (Std or Pro, v4.95), seems to
      >ignore any changes to the LF char. In fact, all it does is complain with
      >"/l+" Not Found.

      I think that Notetab always uses CR/LF when it has a document open.
      If you instead use the disk search (F3) I think it'll work. I don't
      know regex, so I won't go there, but I know it works when I use the
      NTP tokens for LF and CRLF, ^L and ^P. No reason it shouldn't work with rexexp.

      Lotta



      [Non-text portions of this message have been removed]
    • Show all 16 messages in this topic