Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Read input, read file, find match, and output... URGENT HELP!

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Location
    Toronto
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Read input, read file, find match, and output... URGENT HELP!

    Hello there!

    I am working on this final assignment for my IT class, and I have to provide a Query system to a banking program. I have completed the general Query which reads a .txt file and displays the entire clients list for the bank... The code is here:

    clients.txtQuery.txtReadData.txtRecords.txt

    I need to also create a Single Query that will require the user to input a particular Bank ID (we decided xxx where 0<xxx<999) into a pop-up textbox. The idea is that the program will:
    1) read the input xxx value and parse it (String, maybe?).
    2) parse the clients.txt (attached, so you can see the structure and how we tokenized it so it can be displayed as a table) file.
    3) match the entered xxx value to the text line containing the xxx account value.
    4) output that particular account's line from the clients.txt into a one-row, 7-column table.

    I was thinking of maybe using a substring and indexOf but then I got fuzzy...

    I need urgent help with this, as this is due in about 12 hours and I have 2 different projects to work on at the moment. I'm exhausted and can't really think straight, else I would have probably figured this out somehow...

    Any help will be colossally appreciated!

    Cheers,

    Dan


  2. #2
    Junior Member
    Join Date
    Feb 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Read input, read file, find match, and output... URGENT HELP!

    Hi,

    Actually, you wrote the solution. But if the value xxx goes from 0 to 999, that's clear that the data type is int, and is easy to find the match among numbers. Then, you have to make a loop in order to take each line in the clients.txt, make a tokenizer treatment in order to have the specific Bank Id, and then just check if it match with the xxx Bank Id that the user already write.

    Hope that it be useful.
    __________________
    Oscar Gómez
    Engineer at PSL
    PSL S.A. - CMMi 5 nearshore software development and IT outsourcing from Latin America - Home

  3. #3
    Junior Member
    Join Date
    Apr 2012
    Location
    Toronto
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Read input, read file, find match, and output... URGENT HELP!

    I honestly don't even see it, and I've been trying now for a while. I need this done, fast, I barely got an extension from my professor.
    Can you provide a bit more help?

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Read input, read file, find match, and output... URGENT HELP!

    Can you post the code with the problem so it can be seen here?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 1
    Last Post: November 2nd, 2012, 02:21 PM
  2. Read txt file into array and create new output.
    By Margaret_Girl87 in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: March 19th, 2012, 12:08 PM
  3. [SOLVED] How to read from GUI input?
    By KingOfClubs in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: April 21st, 2011, 01:32 PM
  4. Reading user input from the console with the Scanner class
    By JavaPF in forum Java Code Snippets and Tutorials
    Replies: 0
    Last Post: November 11th, 2008, 02:47 PM
  5. How to Read user input from the console with InputStreamReader in Java?
    By JavaPF in forum Java Code Snippets and Tutorials
    Replies: 0
    Last Post: May 19th, 2008, 06:48 AM