Reading and writing files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aaljumah
    New Member
    • Oct 2007
    • 2

    #1

    Reading and writing files

    i am naive with java programming. I would like create a program to read a set of text files, analyze them and create an output in an xml format or at least to another one txt file.

    here is how one of the text file looks like:

    [HTML]=============== =============== =============== =============== =============
    Date: Fri, 29 Sep 2006 10:20:31 -0400
    Reply-To: linguist@LINGUI STLIST.ORG
    Sender: The LINGUIST Discussion List <LINGUIST@LISTS ERV.LINGUISTLIS T.ORG>
    From: LINGUIST Network <linguist@LINGU ISTLIST.ORG>
    Subject: 17.2819, Jobs: English, French & Comp Ling: Programmer,
    Delphes Technologies
    Comments: To: gayatri@linguis tlist.org, linglike@lingui stlist.org
    Mime-Version: 1.0
    Content-Type: text/plain; charset=iso-8859-1
    Content-Transfer-Encoding: 7bit

    LINGUIST List: Vol-17-2819. Fri Sep 29 2006. ISSN: 1068 - 4875.

    Subject: 17.2819, Jobs: English, French & Comp Ling: Programmer, Delphes Technologies

    Moderators: Anthony Aristar, Eastern Michigan U <aristar@lingui stlist.org>
    Helen Aristar-Dry, Eastern Michigan U <hdry@linguistl ist.org>

    Reviews: Laura Welcher, Rosetta Project / Long Now Foundation
    <reviews@lingui stlist.org>

    Homepage: http://linguistlist.or g/

    The LINGUIST List is funded by Eastern Michigan University, Wayne
    State University, and donations from subscribers and publishers.

    Editor for this issue: Catherine Adams <catherin@lingu istlist.org>
    =============== =============== =============== =============== ==== [/HTML]

    the equal marks signal a beginning and an ending of a single issue in the text files. I would like for example to seperate the subject, issue # ...etc and write them to an xml file or to another txt file could anyone help please?


    Thank you so much in adance.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by aaljumah
    i am naive with java programming. I would like create a program to read a set of text files, analyze them and create an output in an xml format or at least to another one txt file.

    here is how one of the text file looks like:

    [HTML]=============== =============== =============== =============== =============
    Date: Fri, 29 Sep 2006 10:20:31 -0400
    Reply-To: linguist@LINGUI STLIST.ORG
    Sender: The LINGUIST Discussion List <LINGUIST@LISTS ERV.LINGUISTLIS T.ORG>
    From: LINGUIST Network <linguist@LINGU ISTLIST.ORG>
    Subject: 17.2819, Jobs: English, French & Comp Ling: Programmer,
    Delphes Technologies
    Comments: To: gayatri@linguis tlist.org, linglike@lingui stlist.org
    Mime-Version: 1.0
    Content-Type: text/plain; charset=iso-8859-1
    Content-Transfer-Encoding: 7bit

    LINGUIST List: Vol-17-2819. Fri Sep 29 2006. ISSN: 1068 - 4875.

    Subject: 17.2819, Jobs: English, French & Comp Ling: Programmer, Delphes Technologies

    Moderators: Anthony Aristar, Eastern Michigan U <aristar@lingui stlist.org>
    Helen Aristar-Dry, Eastern Michigan U <hdry@linguistl ist.org>

    Reviews: Laura Welcher, Rosetta Project / Long Now Foundation
    <reviews@lingui stlist.org>

    Homepage: http://linguistlist.or g/

    The LINGUIST List is funded by Eastern Michigan University, Wayne
    State University, and donations from subscribers and publishers.

    Editor for this issue: Catherine Adams <catherin@lingu istlist.org>
    =============== =============== =============== =============== ==== [/HTML]

    the equal marks signal a beginning and an ending of a single issue in the text files. I would like for example to seperate the subject, issue # ...etc and write them to an xml file or to another txt file could anyone help please?


    Thank you so much in adance.
    1.) Use thread titles that describe your problem
    2.) What have you done so far? Have you looked at the FileReader and or Scanner classes to see what file reading methods are available?

    Comment

    • aaljumah
      New Member
      • Oct 2007
      • 2

      #3
      Originally posted by r035198x
      1.) Use thread titles that describe your problem
      2.) What have you done so far? Have you looked at the FileReader and or Scanner classes to see what file reading methods are available?
      No. Could you help please?

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by aaljumah
        No. Could you help please?
        Read this thread, try some code on your own and post back if you get any problems.

        Comment

        Working...