Someone had asked a scripting question about how to move all .txt files to their respective parent folders. I can't post an answer there since when I click REPLY, it shows me a blank screen.
Anyway, here are the requirements.
Start with folder folder1, find files *.txt in the folder and subfolders, move all .txt files back one level up (into parent folder).
Here is the script.
var str list ; lf -rn "*.txt" "folder1" > $list
while ($list <> "")
var str file ; lex "1" $list > $file
# $file now has the full path of one file. Strip off the last instance of
# /.../ . If that does not exist in full path, this file is at the top level.
var str parent ; stex -r -p "]^/&/^" $file > $parent
# There is no parent folder to copy this file to.
echo $file " is already at the top-most level directory."
system move ("\""+$file+"\"") ("\""+$parent+"\"")
This script is in biterscripting ( http://www.biterscripting.com/install.html