How to read in data from a non-xml text file in Java

Discussion in 'Java' started by truejeff, Mar 18, 2011.

  1. truejeff

    truejeff

    Joined:
    Mar 18, 2011
    Messages:
    1
    Hi, I'm new to this forum. I need some help with java programming.

    I'm writing a program that extract the data in text files and store it's content in its respective fields.

    The input file looks like this.
    I'll like to have
    docno = CNN19981001.0130.0263
    doctype = NEWS
    etcetc as output.

    I tried using SAXparser but I got an error when it parse the "&" character.
    "org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference."
    Was wondering whether there is a better way to read in the file.

    My code:

    Please help me. It's urgent. Thanks in advance.
     
    truejeff, Mar 18, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Krish
    Replies:
    1
    Views:
    1,102
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=
    Oct 20, 2005
  2. mikea_59
    Replies:
    1
    Views:
    621
    Martin Honnen
    Jan 13, 2005
  3. java_newbie

    Java - Read XML file from Java

    java_newbie, May 25, 2009, in forum: Java
    Replies:
    0
    Views:
    943
    java_newbie
    May 25, 2009
  4. Alex Dowad
    Replies:
    4
    Views:
    299
    Michel Demazure
    May 1, 2010
  5. varun7rs@gmail.com
    Replies:
    5
    Views:
    98
    Chris Angelico
    May 14, 2014
Loading...

Share This Page