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

Replacing texts in recursive directories

Expand Messages
  • Hugo Paulissen
    About Replacing texts in recursive directories... ... I ve just come across a tiny (60k) freeware console application (FileScan:
    Message 1 of 1 , Jun 29, 2000
    • 0 Attachment
      About Replacing texts in recursive directories...

      > > ie a command that specifies search and replace in all files of
      > > certain type starting at a top-level directory and going
      > > through all sub-dirs.
      >
      > No, not using regular NoteTab commands. Perhaps some DOS guru
      > can show you a way or a PERL script will do it if you have PERL
      > installed. GREP may do it also.

      I've just come across a tiny (60k) freeware console application (FileScan:
      http://ms-soft.virtualave.net/filescan/readme.html) which can be addressed
      from a clip.
      I'm no expert but I've experimented a little with it and it generates
      filelistings (if no searchstring is given) and it replaces texts in
      recursive directories (though that slows down the operation). Standard
      outputfiles have .out behind their name, but you can generate other output
      file names.

      I couldn't get it to work on my computer with long filenames but in the
      following clip I've used "ShortFileNames and -Paths".

      Here is a first attempt. FileScan is in my NoteTab folder,

      ----------------
      Replace FileScan
      ; This clip uses FileScan, a freeware utility to search and replace
      ; strings of texts.
      ; The clip assumes FileScan is in C:\Program Files\NoteTab Pro
      ; Change it in the ^$GetOutput()$-line
      ^!ClearVariables
      ^!ToolBar New Document
      ^!Set %FilePath%="^?[(T=D)Select Directory=C:\Program Files\NoteTab Pro\]"
      ^!Set %ShortFilePath%="^$GetShort("^%FilePath%")$"
      ^!Set %Extension%=^?[Extension=txt|_ht*|htm|html|*]
      ^!Set %SearchString%=^?[Search for...=]
      ^!Set %ReplaceString%=^?[Replace it with...=]
      ^!Set %Options%=^?[(T=A)Options==Ignore Case^=-c|Recursive directories^=-R]
      ^$GetOutput("C:\Progra~1\NoteTa~1\FileScan -f
      ^%ShortFilePath%*.^%Extension% -s ^%SearchString% -r ^%ReplaceString%
      ^%Options%")$
      ^!Replace ^%ShortFilePath% ^%FilePath% ACIBWS
      ^!Replace FileScan v1.1.0 SR1, 1999-11-27, Markus Strauss
      <Markus.Strauss@...>^PThis program is FREEWARE. I take no responsibility
      for proper function or^Pfor any damage this program might cause.^PUSE AT
      YOUR OWN RISK.^P^PGenerating File list... Result of:
      ^%FilePath%*.^%Extension% CIWS
      --------------------------

      Hugo Paulissen
    Your message has been successfully submitted and would be delivered to recipients shortly.