Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting array elements

Status
Not open for further replies.

peaseblossom

IS-IT--Management
Mar 27, 2007
5
GB
Hi there:
I am trying to write a program that renames all files beginning IMAG (from my camera) to a more descriptive name. I have written the renaming part but if the file name to which the originating file is renamed already exists then the renaming does not take place - and the IMAG file is lost. Sooo....I have written a part that reads the directory for the file name I want to use but I would like to have just the count of the number of files returned into a text box to warn me that my new name is 'taken'. In other words, a count of the elements in the array of the files.
For example, renaming my IMAG file to, say XMAS07 would display the count of the number of files already beginning XMAS07.
And, yes, once I understand that I will look at a loop that checks the file automatically...that is for later!
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top