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

[Clip] Replacing carriage returns with line breaks

Expand Messages
  • Tony Hirtenstein
    For the purposes of a mailing list to be printed in Pagemaker, I need to convert all single carriage returns (CR/LF, ASCII 13/10) in a document to line feeds
    Message 1 of 5 , Jul 13, 2003
    • 0 Attachment
      For the purposes of a mailing list to be printed in Pagemaker, I need to
      convert all single carriage returns (CR/LF, ASCII 13/10) in a document to line
      feeds (LF, ASCII 10) and all double carriage returns to single carriage returns.

      This can be done with Pagemaker (^p for CR/LF, ^n for LF); but I
      wondered whether it could be done in NoteTab, and if so what are the tokens for
      LF and CR/LF?
      According to the Help for NoteTab Pro, "The following are not available
      in NoteTab Pro:
      ^C = Carriage-return ($0D)
      ^L = Line-feed ($0A)
      If you actually need to search characters that correspond to one of the tokens,
      just precede it with an extra ^ symbol "

      Searching for ^^C does not work.


      --

      ******************* A.T.Hirtenstein ****************************
      West Oxfordshire ******************* <tonyh@...>
      "If you take refuge in God, He will bring what you need when you need it."
    • Larry Thomas
      ... line ... returns. ... tokens for ... tokens, ... Hi Tony, What you are describing is the UNIX document format. NoteTab s default setting is for
      Message 2 of 5 , Jul 13, 2003
      • 0 Attachment
        At 06:54 PM 7/13/03 +0100, you wrote:
        > For the purposes of a mailing list to be printed in Pagemaker, I need to
        >convert all single carriage returns (CR/LF, ASCII 13/10) in a document to
        line
        >feeds (LF, ASCII 10) and all double carriage returns to single carriage
        returns.
        >
        > This can be done with Pagemaker (^p for CR/LF, ^n for LF); but I
        >wondered whether it could be done in NoteTab, and if so what are the
        tokens for
        >LF and CR/LF?
        > According to the Help for NoteTab Pro, "The following are not available
        >in NoteTab Pro:
        >^C = Carriage-return ($0D)
        >^L = Line-feed ($0A)
        >If you actually need to search characters that correspond to one of the
        tokens,
        >just precede it with an extra ^ symbol "
        >
        > Searching for ^^C does not work.

        Hi Tony,

        What you are describing is the UNIX document format. NoteTab's default
        setting is for DOS/Windows format. You can make this change in a single
        document by going to the menu bar and selecting Document/Properties... You
        will see a panel come up for Properties. Near the bottom of the panel on
        the left side you will see a drop-down list labeled "Save As" with
        DOS/Windows showing in it. Drop the list down and select UNIX then click
        the ok button and go to the menu and select File/Save As and click on the
        Save button and you document will be saved in UNIX format. I have used a
        hex viewer on my files and when I do this, the 0A 0D pair is replaced by 0A
        only.

        By the way, you cannot do this with search and replace. If your document
        is DOS/Windows formatted when saved the 0A 0D breaks will be restored.

        Regards,

        Larry
        lrt@... e¿ê
      • Larry Thomas
        ... line ... returns. ... tokens for ... tokens, ... Hi Tony, My previous answer did not fully answer your question and I missed the part about wanting to
        Message 3 of 5 , Jul 13, 2003
        • 0 Attachment
          At 06:54 PM 7/13/03 +0100, you wrote:
          > For the purposes of a mailing list to be printed in Pagemaker, I need to
          >convert all single carriage returns (CR/LF, ASCII 13/10) in a document to
          line
          >feeds (LF, ASCII 10) and all double carriage returns to single carriage
          returns.
          >
          > This can be done with Pagemaker (^p for CR/LF, ^n for LF); but I
          >wondered whether it could be done in NoteTab, and if so what are the
          tokens for
          >LF and CR/LF?
          > According to the Help for NoteTab Pro, "The following are not available
          >in NoteTab Pro:
          >^C = Carriage-return ($0D)
          >^L = Line-feed ($0A)
          >If you actually need to search characters that correspond to one of the
          tokens,
          >just precede it with an extra ^ symbol "
          >
          > Searching for ^^C does not work.

          Hi Tony,

          My previous answer did not fully answer your question and I missed the part
          about wanting to convert all double carriage returns to single returns.

          First the <cr/lf> is represented in NoteTab by ^p just the same as in page
          maker. You can do a search and replace of ^p^p^p with ^p^p and keep doing
          it until you get an error message telling that there are not more
          occurrences of the search string. Then you follow the instructions that I
          have before.

          I have actually written a couple of clips that will allow you to switch
          back and forth between the UNIX and DOS/Windows formats.

          H="Convert2UNIX"
          ;lrt@... e¿ê
          ;07/14/2003, 12:38:02 AM
          ^!Replace ^p^p^p >> ^p^p WAIST
          ^!IfError Next ELSE Skip_-1
          ^!Keyboard Alt+D P &50 Alt+V #UNIX# Enter
          ^!Save As ^##

          H="Convert2DOS/Windows"
          ;lrt@... e¿ê
          ;07/14/2003, 12:38:15 AM
          ^!Replace ^p^p^p >> ^p^p WAIST
          ^!IfError Next ELSE Skip_-1
          ^!Keyboard Alt+D P &50 Alt+V #DOS/Windows# Enter
          ^!Save As ^##

          This will convert the currently focused document to the format you choose.

          Regards,

          Larry
          lrt@... e¿ê
        • Tony Hirtenstein
          Dear Larry, Thank you very much for replying to a query I raised in July about converting carriage returns to line feeds for the purpose of a Pagemaker
          Message 4 of 5 , Oct 15, 2003
          • 0 Attachment
            Dear Larry,

            Thank you very much for replying to a query I raised in July about
            converting carriage returns to line feeds for the purpose of a Pagemaker
            publication. My delayed response is due to having been away for two months.

            ; I have actually written a couple of clips that will allow you to switch
            ; back and forth between the UNIX and DOS/Windows formats.
            H="Convert2UNIX"
            ;lrt@... e¿ê
            ;07/14/2003, 12:38:02 AM
            ^!Replace ^p^p^p >> ^p^p WAIST
            ^!IfError Next ELSE Skip_-1
            ^!Keyboard Alt+D P &50 Alt+V #UNIX# Enter
            ^!Save As ^##

            I see that these clips change the way the file is saved. But bringing
            the 'UNIX' text into Pagemaker does not show any lines ending in line feeds
            instead of CR+LF.

            I should explain that the object is to bring a long list of addresses
            into a Pagemaker publication (for printing mailing labels) and have them
            converted to:-
            a line feed between each line of the address; and then
            a carriage return (CR+LF) at the end of the last line of the address.

            The true carriage return causes Pagemaker to advance down the page to
            the beginning of the next label. The line feed on its own goes to the next line
            of the address.

            Perhaps I should attack this problem from the Pagemaker end with a
            script.


            --

            ******************* A.T.Hirtenstein ****************************
            West Oxfordshire ******************* <tonyh@...>
            "If you take refuge in God, He will bring what you need when you need it."
          • Larry Thomas
            Hi Tony, ... next line ... I cannot see how I can help here. The UNIX format converts all ODOA pairs (CR/LF) in the file to a single OA (Line Feed). I did
            Message 5 of 5 , Oct 15, 2003
            • 0 Attachment
              Hi Tony,

              At 10:14 PM 10/15/03 +0100, you wrote:
              >Dear Larry,
              >
              > Thank you very much for replying to a query I raised in July about
              >converting carriage returns to line feeds for the purpose of a Pagemaker
              >publication. My delayed response is due to having been away for two months.
              >
              >; I have actually written a couple of clips that will allow you to switch
              >; back and forth between the UNIX and DOS/Windows formats.
              >H="Convert2UNIX"
              >;lrt@... e¿ê
              >;07/14/2003, 12:38:02 AM
              >^!Replace ^p^p^p >> ^p^p WAIST
              >^!IfError Next ELSE Skip_-1
              >^!Keyboard Alt+D P &50 Alt+V #UNIX# Enter
              >^!Save As ^##
              >
              > I see that these clips change the way the file is saved. But bringing
              >the 'UNIX' text into Pagemaker does not show any lines ending in line feeds
              >instead of CR+LF.
              >
              > I should explain that the object is to bring a long list of addresses
              >into a Pagemaker publication (for printing mailing labels) and have them
              >converted to:-
              > a line feed between each line of the address; and then
              > a carriage return (CR+LF) at the end of the last line of the address.
              >
              > The true carriage return causes Pagemaker to advance down the page to
              >the beginning of the next label. The line feed on its own goes to the
              next line
              >of the address.
              >
              > Perhaps I should attack this problem from the Pagemaker end with a
              >script.

              I cannot see how I can help here. The UNIX format converts all ODOA pairs
              (CR/LF) in the file to a single OA (Line Feed). I did the conversion on
              your text and displayed it in a hex viewer to see the result below:

              Windows/DOS format

              00000000 09 49 20 73 65 65 20 74 68 61 74 20 74 68 65 73 I see that thes
              00000010 65 20 63 6C 69 70 73 20 63 68 61 6E 67 65 20 74 e clips change t
              00000020 68 65 20 77 61 79 20 74 68 65 20 66 69 6C 65 20 he way the file
              00000030 69 73 20 73 61 76 65 64 2E 20 20 42 75 74 20 62 is saved. But b
              00000040 72 69 6E 67 69 6E 67 0D 0A 74 68 65 20 27 55 4E ringing the 'UN
              00000050 49 58 27 20 74 65 78 74 20 69 6E 74 6F 20 50 61 IX' text into Pa
              00000060 67 65 6D 61 6B 65 72 20 64 6F 65 73 20 6E 6F 74 gemaker does not
              00000070 20 73 68 6F 77 20 61 6E 79 20 6C 69 6E 65 73 20 show any lines
              00000080 65 6E 64 69 6E 67 20 69 6E 20 6C 69 6E 65 20 66 ending in line f
              00000090 65 65 64 73 0D 0A 69 6E 73 74 65 61 64 20 6F 66 eeds instead of
              000000A0 20 43 52 2B 4C 46 2E 0D 0A CR+LF.

              UNIX format

              00000000 09 49 20 73 65 65 20 74 68 61 74 20 74 68 65 73 I see that thes
              00000010 65 20 63 6C 69 70 73 20 63 68 61 6E 67 65 20 74 e clips change t
              00000020 68 65 20 77 61 79 20 74 68 65 20 66 69 6C 65 20 he way the file
              00000030 69 73 20 73 61 76 65 64 2E 20 20 42 75 74 20 62 is saved. But b
              00000040 72 69 6E 67 69 6E 67 0A 74 68 65 20 27 55 4E 49 ringing the 'UNI
              00000050 58 27 20 74 65 78 74 20 69 6E 74 6F 20 50 61 67 X' text into Pag
              00000060 65 6D 61 6B 65 72 20 64 6F 65 73 20 6E 6F 74 20 emaker does not
              00000070 73 68 6F 77 20 61 6E 79 20 6C 69 6E 65 73 20 65 show any lines e
              00000080 6E 64 69 6E 67 20 69 6E 20 6C 69 6E 65 20 66 65 nding in line fe
              00000090 65 64 73 0A 69 6E 73 74 65 61 64 20 6F 66 20 43 eds instead of C
              000000A0 52 2B 4C 46 2E 0A R+LF.

              The reason that I cannot see how to help you is that the conversion is all
              or nothing. It does not allow CR/LF pairs in a UNIX file. I don't know
              what you mean "attacking the problem from the Pagemaker end with a script"
              but if you can do it then that is what you may have to do.

              Regards,

              Larry
              lrt@... e¿ê
            Your message has been successfully submitted and would be delivered to recipients shortly.