Results 1 to 2 of 2
  1. #1
    cwbr is offline Member
    Join Date
    Nov 2011
    Posts
    10
    Rep Power
    0

    Default File manipulation

    I'm trying to make a program with a GUI (which I have already finished) that takes an old file extension, a new file extension and a full/partial directory path and changes all files with the old extension to files of the new extension.
    It's just a project, so it needn't be particularly efficient.
    What I'm having trouble with is finding every file with the given extension in the folder. I'm reasonably certain I would be able to figure out how to edit the file then, but any advice on that would also be welcome. I'm also unsure how I would iterate over the files located.
    Thanks

    This is my program so far, the change method is where I'm putting the code I need to add.
    http://ubuntuone.com/051XRtckHaQ1eNHl0Krpnt

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,048
    Blog Entries
    7
    Rep Power
    23

    Default Re: File manipulation

    Have you read the API documentation for the File class? It has a String[] list(FilenameFilter filter) method and a File[] listFiles(FilenameFilter filter) method that can do the job.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

Similar Threads

  1. object manipulation
    By luciawashaya in forum New To Java
    Replies: 2
    Last Post: 11-15-2011, 12:18 PM
  2. Help with String Manipulation
    By RossGoldenstein in forum New To Java
    Replies: 2
    Last Post: 09-28-2011, 04:24 AM
  3. Image Manipulation
    By sh100 in forum New To Java
    Replies: 0
    Last Post: 11-03-2009, 11:18 AM
  4. Array manipulation
    By Ms.Ranjan in forum New To Java
    Replies: 9
    Last Post: 07-18-2008, 09:10 PM
  5. [SOLVED] File Movement/Manipulation
    By Leprechaun in forum New To Java
    Replies: 2
    Last Post: 04-23-2008, 12:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •