Results 1 to 3 of 3
  1. #1
    rubiks is offline Member
    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0

    Default How to read from a random txt file ?

    I need some help, im completly new to java guys.

  2. #2
    AndrewM16921 is offline Senior Member
    Join Date
    Jan 2009
    Location
    CA, USA
    Posts
    264
    Rep Power
    6

    Default Re: How to read from a random txt file ?

    Can you be a little more specific: what part are you having trouble on? Finding an arbitrary file? Selecting a random file in a given directory? Reading a file in general?

  3. #3
    noobplus's Avatar
    noobplus is offline Senior Member
    Join Date
    Feb 2012
    Location
    chennai,south of India(south east of asia)
    Posts
    232
    Rep Power
    3

    Default Re: How to read from a random txt file ?

    Hi
    Java Code:
    BufferedReader in=new BufferedReader(new FileReader ("file.txt")); 
    String inputLine=in.readLine();
    System.out.println(inputLine);
    in.close();
    regards
    dhilip

Similar Threads

  1. Replies: 8
    Last Post: 07-25-2012, 10:00 AM
  2. Replies: 1
    Last Post: 08-05-2011, 09:21 PM
  3. Replies: 0
    Last Post: 02-11-2009, 09:53 AM
  4. Data files - how to read random line?
    By Exhonour in forum New To Java
    Replies: 4
    Last Post: 01-20-2009, 08:28 PM
  5. How to read a text file from a Java Archive File
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-08-2008, 09:13 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
  •