Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

PDF:

From Scratch

File Renamer

A quick and dirty file renaming utility

Issue: 7.1 (November/December 2008)
Author: Brad Rhine
Article Description: No description available.
Article Length (in bytes): 10,729
Starting Page Number: 50
RBD Number: 7120
Resource File(s): None
Related Link(s): None
Known Limitations: None

Excerpt of article text...

Today we're going to write a small utility to help us make file name changes in bulk. I recently had some files -- a lot of files -- from whose names I needed to remove specific strings. I also needed to replace some strings with others. After doing it by hand for a few minutes, I thought, "I should write a REALbasic application to do this!" While writing the program, I thought, "This would make a great From Scratch project!" So here we are.

You might notice that source code is not included for this project, and that's simply because the project is very minimal. If you get stuck, feel free to send me an email, and I'd be happy to share my project file with you or help you out with the code.

Defining The Goal

There were a few specific things I needed my program to do. Given a folder, it should index all of the files contained therein (for my purposes, this didn't need to be recursive). Then for the name of each file, I needed to be able to replace certain string with other strings. Second, I needed to be able to remove certain strings from each file name. Lastly, I needed to be able to add a suffix or prefix to each file name, and the suffix needed to come before the file extension.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com