An editor with better search/replace options...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SeaPlusPlus

    #16
    Re: An editor with better search/replace options...

    >>>SeaPlusPlu s wrote:
    [color=blue][color=green][color=darkred]
    >>>>I want to convert large files of prose to xhtml and so I need a way to
    >>>>remove unwanted line wraps. So, I'm looking for a freebee editor that
    >>>>has the capability of searching for a single "carriage return/line
    >>>>feed" or "line feed/carriage return" and removing them. I quess what I
    >>>>need is an editor that allows non-printable characters in it's search
    >>>>strings.[/color][/color][/color]
    [color=blue][color=green][color=darkred]
    >>>>Does anyone know of on that will allow this?[/color][/color][/color]

    Els wrote:
    [color=blue]
    > No need. TextPad (free evaluation version)can search and replace
    > line-breaks, tabs, spaces. Just need to tick the box that says
    > 'regular expression'.[/color]

    That, Els, is THE ANSWER ! ! ! Thank you. I used it to edit the file
    I'd been working on and finished it no time at all.
    [color=blue]
    > As for wrapping in the editor, TextPad can wrap the lines or leave
    > them run 'off the screen', it's your choice.[/color]

    Wraping in the editor was never the problem. So, thanks again.

    It was all those <new line>'s that needed to be stripped so that they
    wouldn't force the BROWSER to wrap where the BROWSER didn't want to...

    Rich

    Comment

    • C A Upsdell

      #17
      Re: An editor with better search/replace options...

      SeaPlusPlus wrote:[color=blue][color=green][color=darkred]
      >>>> SeaPlusPlus wrote:[/color][/color]
      >
      >[color=green][color=darkred]
      >>>>> I want to convert large files of prose to xhtml and so I need a way
      >>>>> to remove unwanted line wraps. So, I'm looking for a freebee editor
      >>>>> that has the capability of searching for a single "carriage
      >>>>> return/line feed" or "line feed/carriage return" and removing them.
      >>>>> I quess what I need is an editor that allows non-printable
      >>>>> characters in it's search strings.[/color][/color]
      >
      >[color=green][color=darkred]
      >>>>> Does anyone know of on that will allow this?[/color][/color]
      >
      >
      > Del Ferguson wrote:
      >[color=green]
      >> If you no-wrap text and convert to XHTML in NoteTab, the special
      >> character conversions are obvious; however, if you want to do it the
      >> "hard" way, I can send you DOS versions of vi, ed, sed, etc. Works
      >> for me. You are right, NoteTab does not search special characters.
      >> Why bother if XHTML will do all the work? Are you assuming your text
      >> is screwed up?[/color]
      >
      >
      > Del,
      >
      > What are you talking about? XHTML won't 'do all the work' now would it?
      >
      > As you can see, in my original question I said... "large files of prose"
      > to "xhtml".
      >
      > There're <carriage return>'s and/or <line feed>'s sprinkled throughout
      > these "large files of prose". I want to, under program control, search
      > them out, then replace or delete them (with extreme prejudice). ;-)
      >
      > Listen, two line breaks in a row can be considered inter-paragraph and
      > one line break standing alone (surrounded by printable text) can be
      > considered intra-paragraph. I want my editor to search out and dispense
      > the appropriate action.
      >
      > I'd like to change all the line break pairs and any space preceeding or
      > succeeding them to become...
      >
      > <space><new line>
      > </p><new line>
      > <new line>
      > <p><new line>
      >
      > and I'd like to change all the single line breaks and any space
      > preceeding or succeeding them to a single word space.
      >
      > Then, voila, I'll have big chunk of the conversion process completed.[/color]

      NoteTab Pro can do all that.

      Comment

      • SeaPlusPlus

        #18
        Re: An editor with better search/replace options...

        >>>SeaPlusPlu s wrote:
        [color=blue][color=green][color=darkred]
        >>>>I want to convert large files of prose to xhtml and so I need a way to
        >>>>remove unwanted line wraps.[/color][/color][/color]

        Lauri Raittila wrote:
        [color=blue]
        > Why they are unwanted?[/color]

        HUH? This reads like an incomplete thought terminated by a question
        mark... hmmm... even as a question it seems... well... questionable...

        Yes, Lauri, they ARE unwanted. the prose in these files are littered
        with <new line>'s which would inhibit ANY browser from flowing the text
        properly. I realize this is a difficult concept for the uninitiated, but...
        [color=blue][color=green]
        >>So, I'm looking for a freebee editor that[color=darkred]
        >>>>has the capability of searching for a single "carriage return/line feed"
        >>>>or "line feed/carriage return" and removing them. I quess what I need is
        >>>>an editor that allows non-printable characters in it's search strings.[/color][/color][/color]
        [color=blue]
        > Emacs will do that... This question was asked in alt.html last week...[/color]
        [color=blue][color=green][color=darkred]
        >>>>Does anyone know of on that will allow this?[/color][/color][/color]
        [color=blue][color=green]
        >>Eric Kenneth Bustad wrote:[/color][/color]
        [color=blue][color=green][color=darkred]
        >>>Why is this necessary are part of converting the files to xhtml?[/color][/color][/color]
        [color=blue][color=green]
        >>I needed to reference xhtml to pose an on-topic question. If I didn't
        >>say that, you (the 'anal' police) would be posting that my query is
        >>off-topic and I should be posting to some 'editor' newsgroup.[/color][/color]
        [color=blue]
        > Well, why didn't you? As there is not much use remove linefeeds when
        > converting to xhtml. Or any other html...[/color]

        The hell there isn't! what the hell are you talking about?
        [color=blue][color=green]
        >>OBTW, why do you have 'is and 'are' in the same sentence?[/color][/color]
        [color=blue]
        > plonk.[/color]

        Good, remember that next time I post a query.

        Thank you

        Rich

        Comment

        • SeaPlusPlus

          #19
          Re: An editor with better search/replace options...

          Harlan Messinger wrote:
          [color=blue]
          > SeaPlusPlus wrote:
          >[color=green][color=darkred]
          >>> In article <1114788162.bb3 a5b381a3b298cf7 0ea6acc336deb1@ teranews>,
          >>> SeaPlusPlus <SeaPlusPlus@ho tmail.com> wrote:[/color]
          >>
          >>
          >>[color=darkred]
          >>>> I want to convert large files of prose to xhtml and so I need a way
          >>>> to remove unwanted line wraps. So, I'm looking for a freebee editor
          >>>> that has the capability of searching for a single "carriage
          >>>> return/line feed" or "line feed/carriage return" and removing them.
          >>>> I quess what I need is an editor that allows non-printable
          >>>> characters in it's search strings.[/color]
          >>
          >>
          >>[color=darkred]
          >>>> Does anyone know of on that will allow this?[/color]
          >>
          >>
          >> Eric Kenneth Bustad wrote:
          >>[color=darkred]
          >>> Why is this necessary are part of converting the files to xhtml?[/color]
          >>
          >>
          >> I needed to reference xhtml to pose an on-topic question. If I didn't
          >> say that, you (the 'anal' police) would be posting that my query is
          >> off-topic and I should be posting to some 'editor' newsgroup.[/color]
          >
          >
          > So your question is on-topic and we still don't know why you think you
          > need to remove the carriage returns from the text of the pages.[/color]

          I have a lot of what you people may call "CONTENT" which is the whole
          idea of web pages to start with to provide information. The content I
          have is in the form of text files. These text files are formatted (as
          the vast majority of text files are formatted) with <cr><lf> throughout.
          This content would not flow correctly in a browser if all the new line
          information was allowed to remain in the (x)html generated from the
          content file. So, the correct and proper thing to do is to remove the
          unwanted new lines. Surely, you understand why I would like to remove
          the <cr><lf>'s now... am I right?

          Thank you...

          Rich

          Comment

          • Del Ferguson

            #20
            Re: An editor with better search/replace options...

            C A Upsdell > wrote:[color=blue]
            > SeaPlusPlus wrote:
            >[color=green][color=darkred]
            >>>>> SeaPlusPlus wrote:[/color]
            >>
            >>
            >>[color=darkred]
            >>>>>> I want to convert large files of prose to xhtml and so I need a
            >>>>>> way to remove unwanted line wraps. So, I'm looking for a freebee
            >>>>>> editor that has the capability of searching for a single "carriage
            >>>>>> return/line feed" or "line feed/carriage return" and removing
            >>>>>> them. I quess what I need is an editor that allows non-printable
            >>>>>> characters in it's search strings.[/color]
            >>
            >>
            >>[color=darkred]
            >>>>>> Does anyone know of on that will allow this?[/color]
            >>
            >>
            >>
            >> Del Ferguson wrote:
            >>[color=darkred]
            >>> If you no-wrap text and convert to XHTML in NoteTab, the special
            >>> character conversions are obvious; however, if you want to do it the
            >>> "hard" way, I can send you DOS versions of vi, ed, sed, etc. Works
            >>> for me. You are right, NoteTab does not search special characters.
            >>> Why bother if XHTML will do all the work? Are you assuming your text
            >>> is screwed up?[/color]
            >>
            >>
            >>
            >> Del,
            >>
            >> What are you talking about? XHTML won't 'do all the work' now would it?
            >>
            >> As you can see, in my original question I said... "large files of
            >> prose" to "xhtml".
            >>
            >> There're <carriage return>'s and/or <line feed>'s sprinkled throughout
            >> these "large files of prose". I want to, under program control, search
            >> them out, then replace or delete them (with extreme prejudice). ;-)
            >>
            >> Listen, two line breaks in a row can be considered inter-paragraph and
            >> one line break standing alone (surrounded by printable text) can be
            >> considered intra-paragraph. I want my editor to search out and
            >> dispense the appropriate action.
            >>
            >> I'd like to change all the line break pairs and any space preceeding
            >> or succeeding them to become...
            >>
            >> <space><new line>
            >> </p><new line>
            >> <new line>
            >> <p><new line>
            >>
            >> and I'd like to change all the single line breaks and any space
            >> preceeding or succeeding them to a single word space.
            >>
            >> Then, voila, I'll have big chunk of the conversion process completed.[/color]
            >
            >
            > NoteTab Pro can do all that.[/color]

            C A,

            You are completely right about NoteTab being able to do all of that.
            Using the "Modify" options, the text document can be changed
            almost any way you want it. Sea found the way he wanted to do it,
            anyway.

            Cheers,

            Del Ferguson

            Comment

            • Lars Eighner

              #21
              Re: An editor with better search/replace options...

              In our last episode,
              <1114788162.bb3 a5b381a3b298cf7 0ea6acc336deb1@ teranews>,
              the lovely and talented SeaPlusPlus
              broadcast on comp.infosystem s.www.authoring.html:
              [color=blue]
              > I want to convert large files of prose to xhtml and so I need a way to
              > remove unwanted line wraps. So, I'm looking for a freebee editor that
              > has the capability of searching for a single "carriage return/line feed"
              > or "line feed/carriage return" and removing them. I quess what I need is
              > an editor that allows non-printable characters in it's search strings.[/color]
              [color=blue]
              > Does anyone know of on that will allow this?[/color]

              I don't know of any unix editors (joe, (x)emacs, vi, etc. and
              their various flavors and work-alikes) that won't do this.
              However, what you want to do is a one-liner in perl, and if you
              are going to be doing things like this often on multiple files,
              you should look into perl.

              Also, you almost certainly do not want just to remove the end of
              line character(s). You want to replace them with spaces.
              However, in most elements, xhtml and html will treat linefeeds
              as white space to begin with and will collapse multiple white
              spaces, so I am not sure why you need to do this at all.
              [color=blue]
              > Thank you...[/color]
              [color=blue]
              > Rich[/color]
              --
              Lars Eighner eighner@io.com http://www.larseighner.com/
              War on Terrorism: Okay, Unleash OUR Extreme Fundamentalists
              "... all of them who have tried to secularize America, I point the finger in
              their face and say, 'You helped this happen.'" --Jerry Falwell

              Comment

              • Jan Roland Eriksson

                #22
                Re: An editor with better search/replace options...

                On Fri, 29 Apr 2005 16:45:59 -0400, SeaPlusPlus
                <SeaPlusPlus@ho tmail.com> wrote:
                [...][color=blue]
                >I have a lot of what you people may call "CONTENT".. .
                >...in the form of text files ... formatted ... with <cr><lf>
                >throughout.[/color]
                [color=blue]
                >This content would not flow correctly in a browser if all the
                >new line information was allowed to remain in the (x)html
                >generated from the content file.[/color]

                Sure it will.
                [color=blue]
                >So, the correct and proper thing to do is to remove the unwanted
                >new lines. Surely, you understand why I would like to remove the
                ><cr><lf>'s now... am I right?[/color]

                Sorry; no.

                (X)HTML browsers will normalize any sequence of characters #9, #10, #13
                and #32 into one single #32 (space character) at presentation time.

                Even if your source markup should happen to look something like this...

                <p
                [color=blue]
                >[/color]
                Hello

                World,


                here
                I

                come !

                </p[color=blue]
                >[/color]

                Any decent browser will output that as...

                Hello World, Here I come !

                ....white space normalization has been a basic function of HTML browsers
                from the start and for SGML browsers even before them.

                It seems to me that you got yourself hung up on something that you maybe
                did not understand from the start. Set up an experiment with one of your
                "content" files and see for your self.

                I can guarantee you that any random CR,LF,LF,LF,CR, CR,LF (etc...)
                combination in your content will not generate a line break in your
                browser presentation, it will be converted to one single space character
                if you have your content properly marked up.

                One exception, the 'pre' element will suggest to browsers to keep
                original formatting for presentation, but surely you are not planning on
                using that element for large volumes of content?

                --
                Rex


                Comment

                • junk

                  #23
                  Re: An editor with better search/replace options...

                  SeaPlusPlus wrote:[color=blue]
                  >
                  >[color=green][color=darkred]
                  >>>>> Does anyone know of on that will allow this?[/color][/color][/color]
                  Try


                  it's free and has regex search and replace

                  Comment

                  • Harlan Messinger

                    #24
                    Re: An editor with better search/replace options...

                    SeaPlusPlus wrote:[color=blue]
                    > I have a lot of what you people may call "CONTENT" which is the whole
                    > idea of web pages to start with to provide information. The content I
                    > have is in the form of text files. These text files are formatted (as
                    > the vast majority of text files are formatted) with <cr><lf> throughout.
                    > This content would not flow correctly in a browser if all the new line
                    > information was allowed to remain in the (x)html generated from the
                    > content file.[/color]

                    New line sequences in (X)HTML are treated as ordinary whitespace.
                    Consecutive whitespace characters are collapsed automatically into a
                    single space. Therefore, there is no need for you to do this yourself.

                    For example, if your text file looks like this:

                    Line one
                    line two
                    line three

                    and you embed it into an HTML body as follows:

                    <body>
                    <p>
                    Line one
                    line two
                    line three
                    </p>
                    </body>

                    it will look as follows in a browser:

                    Line one line two line three

                    So unless a preliminary conversion would be entertaining for you, you
                    might as well not bother.

                    Comment

                    Working...