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

    Default specific words in a file

    I need some ideas on a programming project.
    I have to check specific words in a file that have a value associated with them
    each value for the most part is unique. so using a file to store all the keywords
    then search on those keywords, because some of keywords are located in different
    locations in this file (i.e. these keywords are in a table, unlike some of the other keywords
    that are located at the beginning of a line), so any guidance would be greatly
    appreciated

    For example
    test = 4
    build = 67
    happy = ABC
    face = sad
    bad = 123tty

    I was thinking of using if statements with methods
    like
    while(site != null) {
    if (file.contains(test)
    get the value for test called 'tvalue'
    test(tvalue);
    if file.contains(build)
    get the value for build called 'bvalue'
    build(bvalue);
    etc.
    }
    then in each method do the value check in there

    how does this sound for an idea

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: specific words in a file

    That looks like a start. Now move the design to the next level and fill in some details.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 14
    Last Post: 02-09-2015, 02:08 AM
  2. Number of words in file. Help.
    By itskeith in forum New To Java
    Replies: 1
    Last Post: 12-02-2012, 11:14 PM
  3. Finding words (and more) in another file
    By Lund01 in forum Java Applets
    Replies: 5
    Last Post: 09-30-2010, 01:03 PM
  4. Replies: 0
    Last Post: 07-15-2010, 01:23 PM
  5. Replies: 2
    Last Post: 11-08-2008, 10:40 AM

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
  •