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

Re: [Clip] Re: delete files containing a search term

Expand Messages
  • Don - HtmlFixIt.com
    ... Also fascinating! So just make my file into a clip, would be easy peasy. I did it to process one file at a time. And since this is not a repetitive
    Message 1 of 8 , Jan 17, 2009
      >> Here is what I did so far:
      >> :Loop
      >> ^!Select Eol
      >> ^!Set %file%="^$GetSelection$"
      >> ^!If "^%file%" = "" END
      >> ^!Keyboard BACKSPACE DELETE
      >> ^!KeyboardDelay 10
      >> ^!DestroyDoc ^%file%
      >> ^!Goto Loop
      >>
      >> Did about 1000 out of 2000 files in about two or three minutes
      >> tops I'd estimate.
      >>
      >
      > Why did you put the ^!Keyboard stuff in there?
      >
      > If I had to use a pure clip, assuming ^!DestroyDoc doesn't require the
      > file to be loaded, I'd do the same thing as before but instead of del
      > space, I'd put ^!DestroyDoc in front of each quoted file name. Then
      > I'd paste the whole thing into a clip and run it.
      >
      > I'd expect the bat file to be the faster though.

      Also fascinating! So just make my file into a clip, would be easy
      peasy. I did it to process one file at a time. And since this is not a
      repetitive process, doing it one time would be fine. Of course this
      clip is "reusable" with another list of files another day.

      I was using the keyboard stuff to advance to the next file and then
      destroy what was on that line. I knew I could also just use cursor
      advance, but this seemed to work ... after I added a short delay. I
      know it's not the fastest.

      I need to put learning dos/batch commands onto my list of things to do.

      I have learned so much from this group it isn't funny.
    • Alec Burgess
      Don - HtmlFixIt.com (don@htmlfixit.com) wrote (in part) (on 2009-01-17 ... commands onto my list of things to do. ... Don (others) - don t know whether you
      Message 2 of 8 , Jan 17, 2009
        Don - HtmlFixIt.com (don@...) wrote (in part) (on 2009-01-17
        at 10:07):
        > I need to put learning dos/batch

        commands onto my list of things to do.


        > I have learned so much from this group it isn't funny.

        Don (others) - don't know whether you were paying attention when we
        discussed the "$GetDosOutput$ clip (especially making it an icon on your
        clipbar) a couple of months ago :-)

        To recap:
        Clip:
        H=GetDOSOutput
        ^!set %theCommand%=^?[Dos command=dir "D:\Temp\*.*" 2>&1]
        ^!InsertText ^%theCommand% ^p
        ^$GetDosOutput("^%theCommand%")$

        The "default" command is just an innocuous DOS command that will be a valid
        DOS command. I normally override it with the command I wish to test or
        execute. Based on Sheri's suggestion I just added the "2>&1". Without it if
        you type "garbage" in the wizard you get a popup error saying:

        No output produced by "c:\windows\system32\cmd.exe /c garbage"

        If instead you leave the 2>&1 on your command line you see:

        garbage 2>&1
        'garbage' is not recognized as an internal or external command,
        operable program or batch file.

        I already knew that, but when I DON"T know what the problem is this makes
        it a lot easier to debug! :-)

        --
        Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)


        [Non-text portions of this message have been removed]
      • Sheri
        ... Hi Alec, I guess I missed that conversation, but I like that clip! FWIW I just changed it a little. Now has last previous command if reused, and keeps the
        Message 3 of 8 , Jan 17, 2009
          --- In ntb-clips@yahoogroups.com, Alec Burgess <buralex@...> wrote:
          >
          > Don (others) - don't know whether you were paying attention when
          > we discussed the "$GetDosOutput$ clip (especially making it an
          > icon on your clipbar) a couple of months ago :-)
          >
          > To recap:
          > Clip:
          > H=GetDOSOutput
          > ^!set %theCommand%=^?[Dos command=dir "D:\Temp\*.*" 2>&1]
          > ^!InsertText ^%theCommand% ^p
          > ^$GetDosOutput("^%theCommand%")$
          >
          > The "default" command is just an innocuous DOS command that will
          > be a valid DOS command. I normally override it with the command I
          > wish to test or execute. Based on Sheri's suggestion I just added
          > the "2>&1". Without it if you type "garbage" in the wizard you
          > get a popup error saying:
          >
          > No output produced by "c:\windows\system32\cmd.exe /c garbage"
          >
          > If instead you leave the 2>&1 on your command line you see:
          >
          > garbage 2>&1
          > 'garbage' is not recognized as an internal or external command,
          > operable program or batch file.
          >
          > I already knew that, but when I DON"T know what the problem is
          > this makes it a lot easier to debug! :-)
          >
          > --
          > Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)
          >
          >

          Hi Alec,

          I guess I missed that conversation, but I like that clip! FWIW I just
          changed it a little. Now has last previous command if reused, and
          keeps the redirection behind the scene.

          H="GetDOSOutput"
          ^!IfEmpty "^%theCommand%" Next Else Skip
          ^!Set %theCommand%="dir "C:\""
          ^!set %theCommand%=^?{Dos command=^%theCommand%}
          ^!InsertText ^%theCommand% 2>&1^p
          ^$GetDosOutput("^%theCommand%" 2>&1)$
          ;end of clip

          Regards,
          Sheri
        • Alec Burgess
          Sheri (silvermoonwoman@comcast.net) wrote (in part) (on 2009-01-17 at ... Hi Sherri - you re up late ;-) Good idea ... DONE I substituted %theCommand% by
          Message 4 of 8 , Jan 17, 2009
            Sheri (silvermoonwoman@...) wrote (in part) (on 2009-01-17 at
            23:41):
            > I guess I missed that conversation, but I like that clip! FWIW I just
            > changed it a little. Now has last previous command if reused, and
            > keeps the redirection behind the scene.
            >
            > H="GetDOSOutput"
            > ^!IfEmpty "^%theCommand%" Next Else Skip
            > ^!Set %theCommand%="dir "C:\""
            > ^!set %theCommand%=^?{Dos command=^%theCommand%}
            > ^!InsertText ^%theCommand% 2>&1^p
            > ^$GetDosOutput("^%theCommand%" 2>&1)$
            > ;end of clip

            Hi Sherri - you're up late ;-)

            Good idea ... DONE

            I substituted %theCommand% by %theDosCommand% only because my habit is
            frequently
            to use variables like %theFile%, %theBuffer" etc. and some day I'm bound
            to wind up with a conflict!

            I had briefly considered putting past commands into either the main INI
            file or a separate one to simulate the same
            capabilities the Find/Replace dialog has but never got-a-round-tuit.

            Flo?


            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.