Results 1 to 2 of 2
  1. #1
    A.M.S is offline Member
    Join Date
    Dec 2008
    Posts
    17
    Rep Power
    0

    Default Reading & Analyzing a Text file and

    Hi everyone ..

    Actually I have a little problem with reading and analyzing files in java :

    if I have a file which contains an English text, and I want to analyze .. and I want to count the number of specific words , and print their index in the file !

    Example :
    "In these ways, the testing methodology provides a window into the total Web Experience from the customerís point of view, providing insight and direction for business decision- makers. Marketing executives discover how they should allocate resources for maximal impact, while designers obtain insight into why particular features and functions are not working as planned and how to best modify them."

    in this text : I have 14 words that their length is 3
    and 3 words as "and", in the indexes : (i,j) , 'i' is the line number and 'j' is the word number in that line ..
    Note : we will ignore the commas and dots.

    question : how do I know if it's gonna be new line, space or whatever ?


    thanks for help :)

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    The readLine method of a BufferedReader already reads line by line.
    If you then split each line by space then you've taken care of the second question as well.

Similar Threads

  1. Reading Integers from a text file
    By tress in forum New To Java
    Replies: 6
    Last Post: 02-26-2011, 06:45 PM
  2. Reading text file into an array
    By Mahesh_ps in forum New To Java
    Replies: 1
    Last Post: 10-09-2009, 04:04 PM
  3. reading data from text file .. help plz
    By Thug heart in forum New To Java
    Replies: 7
    Last Post: 02-15-2009, 08:29 PM
  4. Reading two text file and sum them up
    By matt_well in forum New To Java
    Replies: 36
    Last Post: 07-22-2008, 03:55 AM
  5. Reading text file
    By Lennon-Guru in forum New To Java
    Replies: 1
    Last Post: 12-16-2007, 12:38 AM

Posting Permissions

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