Results 1 to 2 of 2
  1. #1
    nyy132 is offline Member
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Default Search and Delete code help

    So I need to create a simple program but I haven't used java in Windows in a while and I need some help. I need to search the C drive for a folder called "alpha" but it must only contain "alpha" and nothing else such as "alpha_1." After it finds "alpha" it must search within this folder for anything containing the strings "beta" and "gamma." The program must then delete all of these files and/or files with "beta" and "gamma." I'm not really sure where to start and I coould really use some help.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,602
    Rep Power
    23

    Default Re: Search and Delete code help

    Look at the File class for getting lists of files and folders in a folder.
    For simple text files, the Scanner would be easy to use to read files.
    The String class has methods for comparing Strings
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. how to delete/search double linked list
    By Thomaat1 in forum New To Java
    Replies: 5
    Last Post: 04-17-2011, 04:37 PM
  2. Add , edit ,delete code in struts
    By sandy1000 in forum Web Frameworks
    Replies: 0
    Last Post: 12-28-2010, 06:25 AM
  3. I want to add, search, edit, delete record of employee
    By jacob.pham in forum New To Java
    Replies: 2
    Last Post: 07-16-2010, 06:22 AM
  4. Code for adding search function in an application
    By Avdhut in forum Threads and Synchronization
    Replies: 5
    Last Post: 03-03-2009, 10:15 AM
  5. How to delete pre-generated code?
    By Terentius in forum NetBeans
    Replies: 0
    Last Post: 08-19-2008, 04:02 PM

Tags for this Thread

Posting Permissions

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