|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (7 bit)
|
ok so here i am at work, openning folder after folder, renaming file after file....
i have a good knowledge of JAVA (degree in computer science), but i dont know how to do the following: 1. with a given directory, get an array of the folders in it 2. open one of the folders, get an array of the files inside, rename each file basically i need to rename each file to the name of the folder they reside in with a -1, -2, -3, -4, -5, etc appended to the end, then repeat for the next folder of files. seems easy enough, i just dont know the above steps. help! |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
Check out the File class:
http://java.sun.com/j2se/1.4.2/docs/...a/io/File.html It has methods for enumerating directory contents (listFiles), and renaming files (renameTo). If you need more help on those methods, just post
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|