Results 1 to 3 of 3
  1. #1
    lol12345 is offline Member
    Join Date
    Nov 2013
    Posts
    6
    Rep Power
    0

    Exclamation How do I print out a specific part of a text file in java

    import hsa.*;

    How do i write a program that will read every line from a text file but only print out certain words?


    Text file: My goal is to print out the words only , and not the numbers

    Java Code:
    Sir John Abbott
    1821
    1893
    1891
    1892
    Liberal–Conservative
    Sir John Thompson
    1845
    1894
    1892
    1894
    Liberal–Conservative
    Sir Mackenzie Bowell
    1823
    1917
    1894
    1896
    Conservative

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,365
    Rep Power
    6

    Default Re: How do I print out a specific part of a text file in java

    Why do you think you are going to get different responses than in your last thread when you ask the exact same type of question?

    HELP - Math Game Project (import.hsa*)

    Think about it. Write it out on paper first. Nobody is going to TELL you how to do it, that has to come from you and you alone. But if you have doubts about something specific, feel free to ask about it. Also read Surfman's excellent response in this thread to get some ideas on how to start out on a new program:

    Download All Files from a Directory
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    jbarke12's Avatar
    jbarke12 is offline Member
    Join Date
    May 2013
    Location
    Charleston, South Carolina USA
    Posts
    88
    Rep Power
    0

    Default Re: How do I print out a specific part of a text file in java

    Do you know how to read in the text file into an arraylsit of Strings? You have to show us that you are attempting before we can help.
    Last edited by jbarke12; 12-10-2013 at 05:32 PM.

Similar Threads

  1. How do you print results from a text file in java
    By efceddy in forum New To Java
    Replies: 0
    Last Post: 04-05-2013, 03:22 PM
  2. How to print text file in java(dotmatrix printer)
    By yoganeethi in forum Advanced Java
    Replies: 4
    Last Post: 12-01-2010, 02:45 PM
  3. Link to specific part of a Java Servlet
    By jwilley44 in forum Java Servlet
    Replies: 2
    Last Post: 02-03-2009, 02:51 AM
  4. Replies: 2
    Last Post: 11-08-2008, 11:40 AM
  5. Print the text file and print preview them
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 12:04 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
  •