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

Date List

Expand Messages
  • aleksat1
    Hello everybody, I am searching for a clip to create a date list. Giving the starting date (29.08.) and the end date (06.09.) and get such a list: 29.08.
    Message 1 of 12 , Aug 25, 2008
    • 0 Attachment
      Hello everybody,

      I am searching for a clip to create a date list. Giving the starting
      date (29.08.) and the end date (06.09.) and get such a list:

      29.08.
      30.08.
      31.08.
      01.09.
      02.09.
      03.09.
      04.09.
      05.09.
      06.09.

      Maybe only a simple thing, but I am not that much in Clipbook programming.

      Alex
    • Flo
      ... According with your sample data, the following clip is processing days and months only... ^!Replace ^(? d{2} .)(? d{2} .) $ $
      Message 2 of 12 , Aug 26, 2008
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "aleksat1" <rpg.oneword@...> wrote:
        >
        > Hello everybody,
        >
        > I am searching for a clip to create a date list. Giving the starting
        > date (29.08.) and the end date (06.09.) and get such a list:
        >
        > 29.08.
        > 30.08.
        > 31.08.
        > ...

        According with your sample data, the following clip is processing
        days and months only...

        ^!Replace "^(?<day>\d{2}\.)(?<mon>\d{2}\.)" >> "$<mon>$<day>" AWRS
        ^!Select All
        ^$StrSort(^$GetSelection$;0;1;0)$
        ^!Replace "^(?<mon>\d{2}\.)(?<day>\d{2}\.)" >> "$<day>$<mon>" AWRS

        This is similar to a clip that Sheri recently posted in message
        #18133 and uses Named Subpatterns.

        Regards,
        Flo
         
      • Flo
        ... Here s another approach. It works without RegEx and uses the new Date Functions that came with NT 5.7... ^!SetScreenUpdate Off ^!Jump 1 ... ^!Replace
        Message 3 of 12 , Aug 26, 2008
        • 0 Attachment
          --- In ntb-clips@yahoogroups.com, "aleksat1" <rpg.oneword@...> wrote:
          >
          > Hello everybody,
          >
          > I am searching for a clip to create a date list...

          Here's another approach. It works without RegEx and uses the new Date
          Functions that came with NT 5.7...

          ^!SetScreenUpdate Off
          ^!Jump 1

          :DateToInt
          ^!Replace "^$GetLine$" >> "^$GetDateToInt(^$GetLine$;dd/mm/yyyy)$" S
          ^!If ^$GetRow$=^$GetLineCount$ Sort Else Next
          ^!Jump +1
          ^!Goto DateToInt

          :Sort
          ^!Select All
          ^$StrSort(^$GetSelection$;0;1;0)$
          ^!Jump 1

          :IntToDate
          ^!Replace "^$GetLine$" >> "^$GetDateFromInt(^$GetLine$;dd/mm/yyyy)$" S
          ^!If ^$GetRow$=^$GetLineCount$ End
          ^!Jump +1
          ^!Goto IntToDate

          You may test it with the following data...

          01.09.1947
          03.09.1952
          05.09.1999
          29.08.2008
          30.08.2005
          31.08.2005
          02.09.2000
          04.09.2001
          06.09.2002

          Regards,
          Flo
           
        • alek
          ... Your clip is also helpful and thank you for pointing me to the message but I am searching for something a little bit different. I did not need to sort an
          Message 4 of 12 , Aug 26, 2008
          • 0 Attachment
            --- In ntb-clips@yahoogroups.com, "Flo" <flo.gehrke@...> wrote:
            >
            > According with your sample data, the following clip is processing
            > days and months only...
            >
            > ^!Replace "^(?<day>\d{2}\.)(?<mon>\d{2}\.)" >> "$<mon>$<day>" AWRS
            > ^!Select All
            > ^$StrSort(^$GetSelection$;0;1;0)$
            > ^!Replace "^(?<mon>\d{2}\.)(?<day>\d{2}\.)" >> "$<day>$<mon>" AWRS
            >
            > This is similar to a clip that Sheri recently posted in message
            > #18133 and uses Named Subpatterns.
            >
            > Regards,
            > Flo
            >

            Your clip is also helpful and thank you for pointing me to the message
            but I am searching for something a little bit different.

            I did not need to sort an existing, unordered date list. I want to
            create a new date sequence. Giving the starting date and the end date
            Notetab should write this sequence of following days.

            Alek
          • Flo
            ... message ... Alek, Sorry for misunderstanding your question. Try this one... ; Next is one long line - no line breaks! ^!Set
            Message 5 of 12 , Aug 26, 2008
            • 0 Attachment
              --- In ntb-clips@yahoogroups.com, "alek" <rpg.oneword@...> wrote:
              >
              > Your clip is also helpful and thank you for pointing me to the
              message
              > but I am searching for something a little bit different...

              Alek,

              Sorry for misunderstanding your question. Try this one...

              ; Next is one long line - no line breaks!
              ^!Set %Start%=^?[(M="00.00.0000;1;x")Enter start date (dd.mm.yyyy):];
              %End%=^?[(M="00.00.0000;1;x")Enter end date (dd.mm.yyyy):]
              ; Long line end
              ^!Set %Int_Start%=^$GetDateToInt(^%Start%;dd/mm/yyyy)$; %Int_End%
              =^$GetDateToInt(^%End%;dd/mm/yyyy)$
              ^!Toolbar New Document

              :Loop
              ^!InsertText ^%Int_Start%^%NL%
              ^!Inc %Int_Start%
              ^!If ^%Int_Start% > ^%Int_End% Skip
              ^!Goto Loop
              ^!Jump 1

              :Out
              ^!Replace "^$GetLine$" >> "^$GetDateFromInt(^$GetLine$;dd/mm/yyyy)$" S
              ^!If ^$GetRow$=^$GetLineCount$ End
              ^!Jump +1
              ^!Goto Out

              :End
              ; Delete year (yyyy)
              ^!Replace "\d{4}$" >> "" AWRS

              Regards,
              Flo
               
            • Flo
              ... Alex, Thanks for your e-mail reporting that the last clip works fine for you. I enjoy testing those new date functions in NT 5.7 — so here comes another
              Message 6 of 12 , Aug 28, 2008
              • 0 Attachment
                --- In ntb-clips@yahoogroups.com, "Flo" <flo.gehrke@...> wrote:
                >
                > --- In ntb-clips@yahoogroups.com, "alek" <rpg.oneword@> wrote:
                > >
                > > Your clip is also helpful and thank you for pointing me to
                > > the message but I am searching for something a little bit
                > > different...
                >
                > Alek,
                >
                > Sorry for misunderstanding your question. Try this one...


                Alex,

                Thanks for your e-mail reporting that the last clip works fine for
                you.

                I enjoy testing those new date functions in NT 5.7 — so here comes
                another one:

                Given a list of ten dates...

                13.09.2008
                10,4.2002
                2.11.2001
                0408.1998
                24,12.2008
                32.07.2004
                24.12.1999
                17;3.2005
                8.8.2008
                31.12.2007
                01.01.2011

                ...the following clip outputs all invalid dates, i.e. dates having an
                invalid format (typos etc) or being out of range (defined as
                01.01.1980 to 31.12.2010):


                ^!Menu Edit/Copy All
                ^!Toolbar Paste New
                ; Add a leading 0 to single-digit day and month
                ^!Replace "^(\d\.)" >> "0$1" AWRS
                ^!Replace "^(\d\d\.)(\d\.)" >> "$1\0$2" AWRS

                :Check_Format
                ; Mark wrong date format with †
                ^!Find "[^\d.\r\n]" RS
                ^!IfError Skip_3
                ^!Select Line
                ^!Replace "^$GetSelection$" >> "†^$GetSelection$"
                ^!Goto Check_Format
                ^!Jump Doc_Start

                :Check_Date
                ; Check if date returns a valid date integer value in the defined
                ; range from 01.01.1980 to 31.12.2010
                ^!IfInRange ^$GetDateToInt(^$GetLine$;dd/mm/yyyy)$ 29221..40543 Next
                Else Skip
                ; Mark valid date with leading _
                ^!Replace "^$GetLine$" >> "_^$GetLine$"
                ^!If ^$GetRow$=^$GetTextLineCount$ Out Else Next
                ^!Jump +1
                ^!Goto Check_Date

                :Out
                ; Delete valid dates
                ^!Replace "^_.+(\r\n|\z)" >> "" AWRS
                ; Remove † preceding wrong date formats
                ^!Replace "^†" >> "" AWRS
                ^!Jump Doc_Start
                ^!InsertText Invalid dates^P^$StrFill(-;13)$^P

                Maybe this useful too ;-)

                Regards,
                Flo
                 
              • Jeff Scism
                Being a historian/Genealogist I often run into dates that extend further back than 1800, and in some cases dates which predate Christ. Does NoteTab s new
                Message 7 of 12 , Aug 28, 2008
                • 0 Attachment
                  Being a historian/Genealogist I often run into dates that extend further
                  back than 1800, and in some cases dates which predate Christ.

                  Does NoteTab's new Dating utility extend to "-" dates?

                  Jeff

                  Flo wrote:
                  >
                  > --- In ntb-clips@yahoogrou ps.com
                  > <mailto:ntb-clips%40yahoogroups.com>, "Flo" <flo.gehrke@ ...> wrote:
                  > >
                  > > --- In ntb-clips@yahoogrou ps.com
                  > <mailto:ntb-clips%40yahoogroups.com>, "alek" <rpg.oneword@ > wrote:
                  > > >
                  > > > Your clip is also helpful and thank you for pointing me to
                  > > > the message but I am searching for something a little bit
                  > > > different...
                  > >
                  > > Alek,
                  > >
                  > > Sorry for misunderstanding your question. Try this one...
                  >
                  >
                  > Alex,
                  >
                  > Thanks for your e-mail reporting that the last clip works fine for
                  > you.
                  >
                  > I enjoy testing those new date functions in NT 5.7 — so here comes
                  > another one:
                  >
                  > Given a list of ten dates...
                  >
                  > 13.09.2008
                  > 10,4.2002
                  > 2.11.2001
                  > 0408.1998
                  > 24,12.2008
                  > 32.07.2004
                  > 24.12.1999
                  > 17;3.2005
                  > 8.8.2008
                  > 31.12.2007
                  > 01.01.2011
                  >
                  > ...the following clip outputs all invalid dates, i.e. dates having an
                  > invalid format (typos etc) or being out of range (defined as
                  > 01.01.1980 to 31.12.2010):
                  >
                  > ^!Menu Edit/Copy All
                  > ^!Toolbar Paste New
                  > ; Add a leading 0 to single-digit day and month
                  > ^!Replace "^(\d\.)" >> "0$1" AWRS
                  > ^!Replace "^(\d\d\.)(\ d\.)" >> "$1\0$2" AWRS
                  >
                  > :Check_Format
                  > ; Mark wrong date format with †
                  > ^!Find "[^\d.\r\n]" RS
                  > ^!IfError Skip_3
                  > ^!Select Line
                  > ^!Replace "^$GetSelection$ " >> "†^$GetSelection$ "
                  > ^!Goto Check_Format
                  > ^!Jump Doc_Start
                  >
                  > :Check_Date
                  > ; Check if date returns a valid date integer value in the defined
                  > ; range from 01.01.1980 to 31.12.2010
                  > ^!IfInRange ^$GetDateToInt( ^$GetLine$ ;dd/mm/yyyy) $ 29221..40543 Next
                  > Else Skip
                  > ; Mark valid date with leading _
                  > ^!Replace "^$GetLine$" >> "_^$GetLine$ "
                  > ^!If ^$GetRow$=^$ GetTextLineCount $ Out Else Next
                  > ^!Jump +1
                  > ^!Goto Check_Date
                  >
                  > :Out
                  > ; Delete valid dates
                  > ^!Replace "^_.+(\r\n|\ z)" >> "" AWRS
                  > ; Remove † preceding wrong date formats
                  > ^!Replace "^†" >> "" AWRS
                  > ^!Jump Doc_Start
                  > ^!InsertText Invalid dates^P^$StrFill( -;13)$^P
                  >
                  > Maybe this useful too ;-)
                  >
                  > Regards,
                  > Flo
                  >
                  >
                  >


                  --

                  Jeffery G. Scism, IBSSG



                  "In the next place, the state governments are, by the very theory
                  of the constitution, essential constituent parts of the general
                  government. They can exist without the latter, but the latter
                  cannot exist without them."

                  -- Joseph Story (Commentaries on the Constitution, 1833)

                  Reference: Story, Commentaries on the Constitution, 191.
                • Axel Berger
                  ... Thats easily checked: ^!Insert ^$GetDateFromInt(-693550;c)$^P It goes down to 0 AD and stops. It also goes forward a long way. I have not ckecked all the
                  Message 8 of 12 , Aug 28, 2008
                  • 0 Attachment
                    Jeff Scism wrote:
                    > Does NoteTab's new Dating utility extend to "-" dates?

                    Thats easily checked:
                    ^!Insert ^$GetDateFromInt(-693550;c)$^P

                    It goes down to 0 AD and stops. It also goes forward a long way. I
                    have not ckecked all the leap years and the Gregorian reform now,
                    but I'd expect NoteTab to have done a good job.

                    Axel
                  • Jeff Scism
                    ... That s better than EXcel used to be, it wouldn t accept any date BEFORE 1900. Kind tough when you are charting historical docs. OpenOffice by the way does
                    Message 9 of 12 , Aug 28, 2008
                    • 0 Attachment
                      Axel Berger wrote:
                      >
                      > Jeff Scism wrote:
                      > > Does NoteTab's new Dating utility extend to "-" dates?
                      >
                      > Thats easily checked:
                      > ^!Insert ^$GetDateFromInt( -693550;c) $^P
                      >
                      > It goes down to 0 AD and stops. It also goes forward a long way. I
                      > have not ckecked all the leap years and the Gregorian reform now,
                      > but I'd expect NoteTab to have done a good job.
                      >
                      > Axel
                      >
                      That's better than EXcel used to be, it wouldn't accept any date BEFORE
                      1900. Kind tough when you are charting historical docs.

                      OpenOffice by the way does support dates back to "zero" as well.

                      Jeff
                    • Flo
                      ... further ... According with the Help File, these new date functions start with 12/30/1899, its date integer value is 0. So I doubt that they work with
                      Message 10 of 12 , Aug 28, 2008
                      • 0 Attachment
                        --- In ntb-clips@yahoogroups.com, Jeff Scism <jeff@...> wrote:
                        >
                        > Being a historian/Genealogist I often run into dates that extend
                        further
                        > back than 1800, and in some cases dates which predate Christ.
                        >
                        > Does NoteTab's new Dating utility extend to "-" dates?

                        According with the Help File, these new date functions start with
                        12/30/1899, its date integer value is 0. So I doubt that they work
                        with negative values.

                        ^!Info ^$GetDateToInt(12/30/1899;mm/dd/yyyy)$

                        outputs 0, whereas...

                        ^!Info ^$GetDateToInt(12/29/1899;mm/dd/yyyy)$

                        outputs nothing, i.e. it doesn't return a valid date integer value.
                        Strange enough, 12/28/1899 returns a -2.

                        The sample given by Axel...

                        ^!Info ^$GetDateFromInt(-693550;c)$

                        outputs 13.02.0001. But..

                        ^!Info ^$GetDateToInt(02/13/0001;mm/dd/yyyy)

                        returns 36935 which is 13.02.2001. So, obviously, negative values
                        provide no reliable results.

                        Regards,
                        Flo


                        P.S. Regarding my last posting, the e-mail coming from Yahoo has
                        replaced a "dagger" (ANSI 0134) with a question mark ? in the
                        following four lines...

                        ; Mark wrong date format with ?
                        ^!Replace "^$GetSelection$" >> "?^$GetSelection$"
                        ; Remove ? preceding wrong date formats
                        ^!Replace "^?" >> "" AWRS

                        You better correct this replacement when testing the clip! (In the
                        Forum view it's OK).
                      • Axel Berger
                        ... Doubt is part of the religious experience, in this world we just try things out. I did and the results are as stated above. Axel
                        Message 11 of 12 , Aug 28, 2008
                        • 0 Attachment
                          Flo wrote:
                          > So I doubt that they work with negative values.

                          Doubt is part of the religious experience, in this world we just try
                          things out. I did and the results are as stated above.

                          Axel
                        • Flo
                          ... The question whether a science be possible, presupposes a * doubt * as to its actuality (Immanuel Kant, Prolegomena). ;-) From doubt to facts: When
                          Message 12 of 12 , Aug 28, 2008
                          • 0 Attachment
                            --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:
                            >
                            > Doubt is part of the religious experience, in this world we just try
                            > things out...


                            "The question whether a science be possible, presupposes a * doubt *
                            as to its actuality (Immanuel Kant, Prolegomena)." ;-)

                            From doubt to facts: When testing negative values more precisely I
                            get to following results...

                            ^$GetDateFromInt$ ends at -693593 returning 01/01/0001. Any value
                            smaller than -693593 returns 0.0.0000. That is, all values from -1
                            (12/29/1899) to -693593 provide a valid date.

                            ^$GetDateToInt$ ends at 01/01/0100 (-657434). From 12/31/0099
                            (73050) on we don't get usable values any more. That is, all dates
                            from 12/30/1899 (0) to 01/01/0100 provide a valid negative date
                            value. With one exception: 12/29/1899 provides nothing (empty) — a
                            bug in NT 5.7b ?

                            Neither ^$GetDateFromInt$ nor ^$GetDateFromInt$ can deal with dates
                            BC.

                            Regards,
                            Flo
                             
                          Your message has been successfully submitted and would be delivered to recipients shortly.