• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Filename Converter

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to write a program that will read in a directory, check the filenames of every file, organize the files into their own directories with the correct filename format.

I have a list of files in the format:
<firstName> <lastName> - <studentNumber> - <correctName>(<aNumber> ; ) .java
as in:
Derrick Cawthon - 900046067 - UndergraduateStudent( 15 ).java

And they need to come out as a folder named CawthonDerrick and the file within UndergraduateStudent.java.

I have a directory pulled from a file chooser and the files in the directory placed in an ArrayList.

How would I go about checking every file for format errors and make the changes? I was planning on populating a new ArrayList with the files in their correct format. From there I would create a directory with the persons LastName/FirstName and drop the appropriate files into the new directory. I just don't know how to go about implementing this.

Would the Formatter class help any?

[ November 15, 2005: Message edited by: Greg Roberts ]
[ November 15, 2005: Message edited by: Greg Roberts ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic