1 ;; =================================================
2 ;; Script: new-suffix.r
3 ;; downloaded from: www.REBOL.org
5 ;; at: 21:19:08.38986 UTC
6 ;; owner: carl [script library member who can update
8 ;; =================================================
10 Title: "Change File Extensions (Suffix)"
12 Author: "Carl Sassenrath"
15 Change the file extension (suffix) for files with a specific extension.
16 For example, change all .txt files to .r files in the current directory.
17 Displays a list of changes before it makes them.
19 Warning: "Back up your files first, just in case!"
20 License: "BSD - Use at your own risk."
36 bulk-rename: func [confirmed] [
37 foreach file load %./ [
39 not find file #"/" ; (ignore directories)
40 from-suffix = find/last file #"."
43 append clear find/last new-file #"." to-suffix
45 print ["Renaming" file "to" new-file]
48 print ["Will rename" file "to" new-file]
55 if not confirm "Are you sure you want to rename all those files?" [
59 ask "Done. Press enter."