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

Is GetDocListAll case sensitive?

Expand Messages
  • Jean-François Colas
    Hi all, First, a great thank for all the valuable infos about the Find dialog box. For today, I have a problem with GetDocListAll, which seems not to take
    Message 1 of 4 , Oct 21, 2011
    • 0 Attachment
      Hi all,

      First, a great thank for all the valuable infos about the Find dialog
      box. For today, I have a problem with GetDocListAll, which seems not to
      take account of case sensitivity...

      I'm processing files whose lines are like below:
      1 avantveille
      1 monstreuse
      1 Colorado
      1 spectable
      1 pas'de
      1 precipiter
      ...
      2 7e
      2 Gregorio
      2 new-yorkaise
      2 Maroc
      2 leures
      2 cho
      ...
      50 Manfred
      52 John

      (these are misspelled words against french vocabulary).

      What I try to do is extract all lines where the "word" starts with a
      lowercase character, in order to put all those lines at the top of the
      file. I did the same with strings containing an hyphen and that works
      fine. But here I cannot distinguish between lowercase and other strings.

      Here is what I tried:

      H="FiltreMinusculesOrd"
      ; filtrage des lignes d'un .ord commençant par une minuscule
      ; Le script les collecte et le place au début du fichier.
      ^!set %Minuscules%=^$GetDocListAll("(^ +\d+ +[[:lower:]].+$)";"$1\r\n")$
      ^!Replace "(^ +\d+ +[[:lower:]].+\R)" >> "" wtras
      ^!jump 1
      ^%minuscules%


      GetDocListAll seems to return actually every line starting with a
      letter, lowercase or uppercase, unless a make a mistake. On the
      contrary, the ^!Replace command does what I expected.
      I'm with NoteTab light 6.2.

      If it would impossible to achive that with GetDocListAll, would another
      way exist?

      Thanks,
      J.-F.
    • John Shotsky
      One easy way to do that would be to add a zero to the front of each line that has a lower case letter following the number, then sort the list, then remove the
      Message 2 of 4 , Oct 21, 2011
      • 0 Attachment
        One easy way to do that would be to add a zero to the front of each line that has a lower case letter following the
        number, then sort the list, then remove the zero.

        ^!Replace "^(?=\d+\x20\p{Ll})" >> "0" ARSW
        ^!Toolbar Sort Ascending
        ^!Replace "^0" >> "" ARSW

        1 avantveille
        1 monstreuse
        1 pas'de
        1 precipiter
        1 spectable
        2 cho
        2 leures
        2 new-yorkaise
        1 Colorado
        2 7e
        2 Gregorio
        2 Maroc
        50 Manfred
        52 John

        Regards,
        John

        From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Jean-Fran�ois Colas
        Sent: Friday, October 21, 2011 02:52
        To: ntb-clips@yahoogroups.com
        Subject: [Clip] Is GetDocListAll case sensitive?


        Hi all,

        First, a great thank for all the valuable infos about the Find dialog
        box. For today, I have a problem with GetDocListAll, which seems not to
        take account of case sensitivity...

        I'm processing files whose lines are like below:
        1 avantveille
        1 monstreuse
        1 Colorado
        1 spectable
        1 pas'de
        1 precipiter
        ...
        2 7e
        2 Gregorio
        2 new-yorkaise
        2 Maroc
        2 leures
        2 cho
        ...
        50 Manfred
        52 John

        (these are misspelled words against french vocabulary).

        What I try to do is extract all lines where the "word" starts with a
        lowercase character, in order to put all those lines at the top of the
        file. I did the same with strings containing an hyphen and that works
        fine. But here I cannot distinguish between lowercase and other strings.

        Here is what I tried:

        H="FiltreMinusculesOrd"
        ; filtrage des lignes d'un .ord commen�ant par une minuscule
        ; Le script les collecte et le place au d�but du fichier.
        ^!set %Minuscules%=^$GetDocListAll("(^ +\d+ +[[:lower:]].+$)";"$1\r\n")$
        ^!Replace "(^ +\d+ +[[:lower:]].+\R)" >> "" wtras
        ^!jump 1
        ^%minuscules%

        GetDocListAll seems to return actually every line starting with a
        letter, lowercase or uppercase, unless a make a mistake. On the
        contrary, the ^!Replace command does what I expected.
        I'm with NoteTab light 6.2.

        If it would impossible to achive that with GetDocListAll, would another
        way exist?

        Thanks,
        J.-F.



        [Non-text portions of this message have been removed]
      • flo.gehrke
        ... The problem is in the Posix Character Class. Quite often I experience that [:upper:] or [:lower:] is not processed correctly unless you add a (?-i)
        Message 3 of 4 , Oct 21, 2011
        • 0 Attachment
          --- In ntb-clips@yahoogroups.com, Jean-François Colas <jfcolas@...> wrote:
          >
          > For today, I have a problem with GetDocListAll, which seems not
          > to take account of case sensitivity...

          The problem is in the Posix Character Class. Quite often I experience that '[:upper:]' or '[:lower:]' is not processed correctly unless you add a '(?-i)' modifier that prevents case from being ignored.

          So try...

          ^$GetDocListAll("(?-i)^\x20+\d+\x20+[[:lower:]].+$";"$0\r\n")$

          I wrote the spaces with hex '\x20' in order to make them more visible.

          Regards,
          Flo
        • Jean-François Colas
          Hi Flo & all, It works fine! Seems I missed the part of doc that mentions stuff like (?-i). J.-F.
          Message 4 of 4 , Oct 21, 2011
          • 0 Attachment
            Hi Flo & all,

            It works fine! Seems I missed the part of doc that mentions stuff like
            (?-i).

            J.-F.

            Le 21/10/2011 16:34, flo.gehrke a écrit :
            > --- In ntb-clips@yahoogroups.com, Jean-François Colas<jfcolas@...> wrote:
            >>
            >> For today, I have a problem with GetDocListAll, which seems not
            >> to take account of case sensitivity...
            >
            > The problem is in the Posix Character Class. Quite often I experience that '[:upper:]' or '[:lower:]' is not processed correctly unless you add a '(?-i)' modifier that prevents case from being ignored.
            >
            > So try...
            >
            > ^$GetDocListAll("(?-i)^\x20+\d+\x20+[[:lower:]].+$";"$0\r\n")$
            >
            > I wrote the spaces with hex '\x20' in order to make them more visible.
            >
            > Regards,
            > Flo
            >
            >
            >
            >
            > ------------------------------------
            >
            > Fookes Software: http://www.fookes.com/
            > NoteTab website: http://www.notetab.com/
            > NoteTab Discussion Lists: http://www.notetab.com/groups.php
            >
            > ***
            > Yahoo! Groups Links
            >
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.