Results 1 to 2 of 2
  1. #1
    leebee is offline Member
    Join Date
    Jul 2007
    Rep Power

    Question Reading from a file


    I am trying to read from a file which i have done but the other file i have to read from has comments with # at the start of the line,

    How do i make my bufferedReader ignore the lines starting with a #


  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Rep Power


    Read those lines and check if they start with a #. You can do that by using charAt() function of the String class. There should also be a method there (or inside Character class) to check if a character is a whitespace or not..

Similar Threads

  1. Reading a properties file
    By peiceonly in forum New To Java
    Replies: 7
    Last Post: 05-06-2010, 05:17 PM
  2. Reading a File into ByteArray
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-15-2008, 03:19 PM
  3. Reading a file
    By mew in forum New To Java
    Replies: 2
    Last Post: 12-30-2007, 12:23 PM
  4. Reading text file
    By Lennon-Guru in forum New To Java
    Replies: 1
    Last Post: 12-15-2007, 11:38 PM
  5. Reading a file for use
    By peachyco in forum New To Java
    Replies: 2
    Last Post: 11-27-2007, 03:49 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