#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Aalborg, Denmark
    Posts
    36
    Rep Power
    15

    Read vars from a text file


    Hi,

    I need to read an ip-adress from a text file.

    The line in the text-file is formatted as:

    ...
    ip:192.168.0.1 //Comment
    ...

    I know how to read the file, but how do i only read the ip-adress and not the rest of the line. And how do i validate that it has the proper format for an ip-adress?

    Thanks

    // Martin
  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    What version of the jdk are you using? (Hint: it's a whole boat-load easier if you can use 1.4)

IMN logo majestic logo threadwatch logo seochat tools logo