- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Delete files in a folder
Hi All,
Is there a way to delte all .txt,.csv,.jrn and .png files in a folder before running a script to repopulate everything?
I do want to keep my. json file in the same folder.
Thank you so much. I really appreciate your time and effort.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Delete files in a folder
Oops, the word() functions reference should have been
If(word(-1,Y[i],".") == "txt"
negative values indicate to count from the right, positive values count from the left
Go to
Help==>Scripting Index==Functions==>Character==>Word
for documentation and example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Delete files in a folder
You can use
Y = Files In Directory( <Path"=> );
to get the files, and then loop through the list of files and determine if the file is of the type you want to delete, and then delete it
If(word(=1,Y[i],".") == "txt",
r= Delete File(<path> || Y[i]);
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Delete files in a folder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Delete files in a folder
Oops, the word() functions reference should have been
If(word(-1,Y[i],".") == "txt"
negative values indicate to count from the right, positive values count from the left
Go to
Help==>Scripting Index==Functions==>Character==>Word
for documentation and example