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

[Clip] [NB] ^$GetFileFirst Sorting

Expand Messages
  • Jody
    Hi All, Can somebody check my script and two things. I snipped a bunch of stuff out to make it as short as I could. It is set up to give you a list of file
    Message 1 of 4 , Feb 1, 2000
    • 0 Attachment
      Hi All,

      Can somebody check my script and two things. I snipped a bunch
      of stuff out to make it as short as I could. It is set up to
      give you a list of file name in a folder now. Sort by Name and
      Rev. I do not see it reversed, but I do with other sorting
      orders.

      Next, take the commented places out and set it up to append to
      file and the open it. Sort by date, no Rev. I get all the files
      duplicated like it is going through the folder twice which has
      three text files in it, but not with the other sorting methods.

      Thanks.

      H=AppendTo...
      ^!ClearVariables

      ; long line till blank
      ^!Set %Folder%=^?{(T=D)Browse: full path, end in backslash=^$GetDocumentPath$}; %Type%=^?{(H=10)File &Types, wildcards OK=*.txt}; %Sort%=^?{Sorting method=Unsorted|Name|Type|_Date|Size}; %Rev%=^?{Reverse sorting=_No^=|Yes^=Rev}; %Divide%=^%nl%^?{Add separator=^$GetDate(mm-dd-yyyy)$}^%nl%; %All%=^?{Filename for all appended files=All.txt}

      ^!SetHintInfo Working...
      ^!SetScreenUpdate Off

      ^!Set %FullPath%=^$GetFileFirst(^%Folder%;"^%Type%";^%Rev%^%Sort%)$
      ^!IfTrue ^$IsEmpty("^%FullPath%")$ Error

      :Loop
      ^!IfTrue ^$IsEmpty(^%FullPath%)$ CloseFileFind
      ^!Set %File%=^$GetFileName(^%FullPath%)$^%Divide%^%nl%
      ^!Append %FileList%=^%File%
      ; Remove the comment below and add one to two lines above.
      ; ^!AppendToFile "^%Folder%^%All%" ^$GetFileText(^%FullPath%)$^%Divide%
      ^!Set %FullPath%=^$GetFileNext$
      ^!Goto Loop

      :CloseFileFind
      ^!Info ^%FileList%
      ; Take out the comment below and add above.
      ; ^!Open "^%Folder%^%All%"
      ^!Goto End

      :Error
      ^!Info Oops! No files by search type found.

      Happy Clip'n!
      Jody

      http://www.sureword.com/notetab

      Subscribe, UnSubscribe, Options
      mailto:Ntb-Clips-Subscribe@...
      mailto:Ntb-Clips-UnSubscribe@...
      http://www.egroups.com/list/ntb-clips
    • Eb Guenther
      Hi Jody, Your second question: As long as the destination file has the same filespec as the source files, your script will treat it as a source file, same as
      Message 2 of 4 , Feb 2, 2000
      • 0 Attachment
        Hi Jody,

        Your second question:

        As long as the destination file has the same filespec as the
        source files, your script will treat it as a source file, same
        as the others.

        Sorry, ran out of time for your first question.


        Eb


        > Can somebody check my script and two things. I snipped a bunch
        > of stuff out to make it as short as I could. It is set up to
        > give you a list of file name in a folder now. Sort by Name and
        > Rev. I do not see it reversed, but I do with other sorting
        > orders.

        > Next, take the commented places out and set it up to append to
        > file and the open it. Sort by date, no Rev. I get all the files
        > duplicated like it is going through the folder twice which has
        > three text files in it, but not with the other sorting methods.
      • Jody
        Hi Eb, ... I don t see where that would make the new file of appended files (3 of them in this case) look like NoteTab ran through the directory twice as in
        Message 3 of 4 , Feb 2, 2000
        • 0 Attachment
          Hi Eb,

          > As long as the destination file has the same filespec as the
          > source files, your script will treat it as a source file, same
          > as the others.

          I don't see where that would make the new file of appended files
          (3 of them in this case) look like NoteTab ran through the
          directory twice as in the names below represent the file text.

          File1.txt
          File2.txt
          File3.txt
          File1.txt
          File2.txt
          File3.txt

          However, I did some more testing. I need to do some more, but it
          appears that if Beta.txt happens to be one of the files being
          appended some of the code causes NoteTab to do it again.

          Thanks for answering to this part:

          >> Next, take the commented places out and set it up to append to
          >> file and the open it. Sort by date, no Rev. I get all the
          >> files duplicated like it is going through the folder twice
          >> which has three text files in it, but not with the other
          >> sorting methods.

          Happy Clip'n!
          Jody

          http://www.sureword.com/notetab

          Subscribe, UnSubscribe, Options
          mailto:Ntb-Clips-Subscribe@...
          mailto:Ntb-Clips-UnSubscribe@...
          http://www.egroups.com/list/ntb-clips
        • Jody
          Hi Eb and All, ... File1.txt File2.txt File3.txt File1.txt File2.txt File3.txt I figured out what is going on, but I do not understand it. If I delete the
          Message 4 of 4 , Feb 2, 2000
          • 0 Attachment
            Hi Eb and All,

            > The new file of appended files (3 of them in this case) look
            > like NoteTab ran through the directory twice as in the names
            > below represent the file text.

            File1.txt
            File2.txt
            File3.txt
            File1.txt
            File2.txt
            File3.txt

            I figured out what is going on, but I do not understand it. If I
            delete the "master" file each time, then it works properly for
            sorting by Date w/o getting the double of everything. One of the
            first things I checked of course was to make sure I was clearing
            the variables which I was and NoteTab is doing. However, when I
            clear the master file out that has the three files appended and
            save it then run the Clip again I get them twice. One set of
            three and then the second set follows.

            I left the file with one set in it and ran the Clip again. I would
            thing that it should only add one more set of three, but no, like
            above, two sets get added.

            OK, so I did the same file with three sets a third time. Now it
            has ten sets and I would think it should have three sets.

            Next I cleared the file out again and saved it. Ran the Clip and
            it was find, one of each file. I switch to WE and renamed the
            files. I still got the two sets even with a different file name.

            Mind Boggled in Milton,
            Jody


            Happy Clip'n!
            Jody

            http://www.sureword.com/notetab

            Subscribe, UnSubscribe, Options
            mailto:Ntb-Clips-Subscribe@...
            mailto:Ntb-Clips-UnSubscribe@...
            http://www.egroups.com/list/ntb-clips
          Your message has been successfully submitted and would be delivered to recipients shortly.