Results 1 to 2 of 2
  1. #1
    kram54 is offline Member
    Join Date
    Dec 2010
    Posts
    1
    Rep Power
    0

    Unhappy Help ! Read from txt to array an than search

    hi everyone .. i want to make read file send array and seach something

    1.txt
    10 A Z
    11 A B
    12 B U
    13 B G

    2.txt
    A 1
    B 2
    Z 3
    U 4
    G 5

    if user write to A in textfield

    output

    a = z(3+10) --- b(3+11)
    b= u(2+12) --- g(2+13)


    anyone help me ?

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    anyone help me ?

    (1) Begin with a clear description of the contents of the input files. (How many elements are there in each line of a file? How are they separated? Are the numeric elements always distinct within a file? Are the other elements always an upper case letter? Are there any other constraints on the elements of a line?)

    (2) Formulate a precise description of the desired output for any given input.

    ---------------------

    Then, later, begin to code.

    Your description answering point (1) will help you create classes instances of which might represent the data in a file. Or other, simpler, data structures if they are sufficient. For instance you might represent the text files as a list of string arrays.

    Much later you can address the questions of the two tasks your program must perform:

    * populating the data structures from the file

    * searching within the data structures for a match with some given input.

    Much, much, later you can being work on a GUI. (If that was the intention of your post's reference to the input coming from a text field.)

    ------------------

    This is all very general. For more specific help we need a (or more specific) question. That is, describe what you are doing - not the desired end result, but the actual steps you are taking to get there - and supply the code that is giving rise to the problem.
    Last edited by pbrockway2; 12-09-2010 at 12:54 AM.

Similar Threads

  1. Search in the array
    By ŖΫ ỏ Ңόρę in forum New To Java
    Replies: 4
    Last Post: 04-28-2010, 09:02 AM
  2. How do I search an array from a different class?
    By Psyclone in forum New To Java
    Replies: 6
    Last Post: 02-04-2010, 01:21 AM
  3. Mostly completed array search program
    By Ryujin89 in forum New To Java
    Replies: 1
    Last Post: 11-04-2009, 04:25 AM
  4. Search a string in a byte array
    By 2BOrNot2B in forum New To Java
    Replies: 0
    Last Post: 03-12-2009, 06:52 PM
  5. Array Search Test
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-14-2008, 09:45 PM

Posting Permissions

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