Results 1 to 3 of 3
  1. #1
    smn
    smn is offline Member
    Join Date
    Aug 2010
    Posts
    9
    Rep Power
    0

    Default how to read only parts of textfile by java

    Hi,
    I have a file that the name ,family and countries are stored. if i'm interested to one of these fields, how can i retrieve them. for example i'm interested to see only family name of the users.

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    if the file is formatted in comma separated (CSV) or perhaps tab delimited, and one record per line, you could use a CSV parser to tokenize the line into record fields.
    Or if it is XML file, parse the node containing the family name.
    once you are able to find just the field you are interested in, you can have all of the things in the file printed out to System.out.println, or populated into a List<String> .?

  3. #3
    smn
    smn is offline Member
    Join Date
    Aug 2010
    Posts
    9
    Rep Power
    0

    Default

    thnx for ur help,i've got what to do and could solve it ;)

Similar Threads

  1. Replies: 5
    Last Post: 10-17-2008, 03:13 PM
  2. Cutting parts of an image and reordering them
    By pedjacar in forum Java 2D
    Replies: 2
    Last Post: 10-16-2008, 10:46 AM
  3. reading textfile from java problem
    By saytri in forum New To Java
    Replies: 1
    Last Post: 01-17-2008, 03:13 AM
  4. textfile with Java problems
    By saytri in forum New To Java
    Replies: 4
    Last Post: 12-29-2007, 06:16 PM
  5. Selecting parts of an image
    By shaungoater in forum Java 2D
    Replies: 1
    Last Post: 12-15-2007, 11:06 PM

Tags for this Thread

Posting Permissions

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