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

RE: [Clip] Re: Upper & Low cases

Expand Messages
  • John Shotsky
    You re right. Since my work deals with recipes, I encounter many such letters. Have not found a good solution other than either listing them, or including some
    Message 1 of 15 , Aug 12, 2009
    View Source
    • 0 Attachment
      You're right. Since my work deals with recipes, I encounter many such letters. Have not found a good solution other than
      either listing them, or including some mini-ranges to capture them.

      However, almost never does a line start with an accented letter, and usually, upper case letters should not be accented
      anyway.

      Then, there could be a problem if a line starts with a quote, double quote or a paren and is followed by a lower case
      letter -

      In the segment below, I'd use \R+ instead of \R\R, since I don't think there is a rule that there must be a blank line
      between all other lines, and it will also miss the first row, if it is lower case, unless a leading blank line is added.
      John

      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Axel Berger
      Sent: Wednesday, August 12, 2009 07:46
      To: ntb-clips@yahoogroups.com
      Subject: Re: [Clip] Re: Upper & Low cases


      "c.brito78" wrote:
      > I will test.

      In that version I have used John's Find. I just realized, that this will
      not get umlauts or any other kind of accented letter. So in hindsight
      I'll go back and recommend my older version:

      ^!Find "(?s)\R\R(.)" RS1

      Axel



      [Non-text portions of this message have been removed]
    • Axel Berger
      ... Sorry, but in this case I claim superior knowledge as a German: Ärger, Ångstrøm, Über (capitalized as the first word of a sentence), Ölsand ... If my
      Message 2 of 15 , Aug 12, 2009
      View Source
      • 0 Attachment
        John Shotsky wrote:
        > and usually, upper case letters should not be accented anyway.

        Sorry, but in this case I claim superior knowledge as a German: Ärger,
        Ångstrøm, Über (capitalized as the first word of a sentence), Ölsand ...
        If my French were acceptable, I'm sure I'd find many more examples there
        too.

        > Then, there could be a problem if a line starts with a quote,
        > double quote or a paren and is followed by a lower case letter

        True. We don't know how paragraphs and thus presumably sentences came to
        be uncapitalized in the first place, but C. specified "first character"
        in his request.

        > In the segment below, I'd use \R+ instead of \R\R, since I don't
        > think there is a rule that there must be a blank line

        My understandig was that line feeds that are not paragraphs were the
        issue here and should not be modified. As you noted yourself "The clip I
        provided ignores blank lines."

        Axel
      • Sheri
        Just another possibility: This one loops from the top finding only lower case letters as the first character of a line (possibly preceeded by a double quote)
        Message 3 of 15 , Aug 12, 2009
        View Source
        • 0 Attachment
          Just another possibility: This one loops from the top finding only lower case letters as the first character of a line (possibly preceeded by a double quote) and capitalizes them. Works for plain and accented latin characters.

          ^!Jump Doc_start
          :loop
          ^!Find "^\x22?\K\p{Ll}" RS
          ^!Iferror Out
          ^!Menu Modify/Text Case/Upper Case
          ^!Goto loop
          :Out

          Regards,
          Sheri
        • ebbtidalflats
          I d like to offer my 2 cents worth (or as Axel would say, his mustard): To change the case of EVERY first character of every line, WITHOUT LOOPING, use the
          Message 4 of 15 , Aug 15, 2009
          View Source
          • 0 Attachment
            I'd like to offer my 2 cents worth (or as Axel would say, his mustard):

            To change the case of EVERY first character of every line,
            WITHOUT LOOPING, use the BLOCK mode and a helper file,
            something like (untested):

            ^!SetWordWrap OFF
            ^!SelectTo ^$GetLineCount$:2
            ^!Menu Modify/Block/Cut
            ^!Set %orig%=^$GetDocIndex$
            ^!Menu File/New
            ^!Set %helper%=^$GetDocIndex$
            ^!Menu Edit/Paste
            ^!Menu Modify/"Text case"/"Upper case"
            ^!Select All
            ^!Menu Modify Block/Copy
            ^!SetDocIndex ^%orig%
            ^!SetCursor 1:1
            ^!Menu Block/Paste
            ^!DestroyDoc ^$GetDocName(^%helper%)$

            Anybody care to time executions of the various solutions?

            Cheers,

            Eb


            --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:
            >
            > John Shotsky wrote:
            > > and usually, upper case letters should not be accented anyway.
            >
            > Sorry, but in this case I claim superior knowledge as a German: Ärger,
            > Ångstrøm, Über (capitalized as the first word of a sentence), Ölsand
          Your message has been successfully submitted and would be delivered to recipients shortly.