WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> How to... >> WD to create and modify text files?
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1098171988

Message started by Chris_Quan on Oct 19th, 2004 at 3:46pm

Title: WD to create and modify text files?
Post by Chris_Quan on Oct 19th, 2004 at 3:46pm
I assume this is not what WD is designed to do. There are many search and replace utilities. However, I have yet to find one that will let me create and modify text files. If the new folder is created, WD will create a text file inside

For example, it will create a text file using the folder name for each of the folders (and sub-folders). Below is an example of the content of the text file.

@TI=FULL_Path_To_The_Folder
@CZ=Higher_Level_Folder_Name
@FZ=Folder_Name

Chris

Title: Re: WD to create and modify text files?
Post by Gert on Oct 19th, 2004 at 4:21pm
Modifying the text file would be tricky, but something like the following should do:
[code]
@echo off
if "%WD_REASON%" NEQ "DIRNEW" GOTO :QUIT

echo @TI=%WD_FILE% > "%WD_FILE%\folderinfo.txt"
echo @FZ=%WD_FILE_N% >> "%WD_FILE%\folderinfo.txt"

:QUIT
[/code]

I am not sure what the @CZ thing is supposed to be...

Gert

Title: Re: WD to create and modify text files?
Post by Chris_Quan on Oct 19th, 2004 at 4:27pm
Absolutely awesome!  This saves me a lot of nap time.. This is cool. Thanks again.

Chris

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.