Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Problem parsing WHOIS date from text and capturing fields

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Problem parsing WHOIS date from text and capturing fields

    Hello,

    I'm a bit stuck and a little lost here...

    I am trying to create a Java-based GUI that queries WHOIS and writes certain WHOIS properties to a 3rd party app. I currently have a functioning Java Swing-based GUI that successfully returns the WHOIS text from the query. However, I have no idea how to parse this data and capture the info I need to variables. For example, from the text returned I need a field for registrar, Administrative contact, Technical contact, etc. I'd like to just capture these and display them in the panel somewhere before I hit a button to send them to the other app, which shouldn't be an issue once I have the correct data in the variables. Anyone have any ideas or tips on how to do this. Any info is greatly appreciated.

    Thanks!


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Problem parsing WHOIS date from text and capturing fields

    I have no idea how to parse this data and capture the info I need
    In what format is the data? Can you post a sample if it is text in a String?
    Anyone have any ideas or tips on how to do this.
    That would depend on the format of the data.

  3. #3
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Problem parsing WHOIS date from text and capturing fields

    Hi Norm, thanks for the reply!

    So for clarification, the problem is really, that I get a stream of data that looks like this:
    Whois Server Version 2.0

    Domain names in the .com and .net domains can now be registered
    with many different competing registrars. Go to InterNIC | The Internet's Network Information Center
    for detailed information.

    Domain Name: AL.COM
    Registrar: CSC CORPORATE DOMAINS, INC.
    Whois Server: whois.corporatedomains.com
    Referral URL: http://www.cscglobal.com
    Name Server: NS.ADVANCE.NET
    Name Server: NS2.ADVANCE.NET
    Status: clientTransferProhibited
    Updated Date: 06-may-2010
    Creation Date: 23-apr-1997
    Expiration Date: 24-apr-2016
    and I just really need to get variables such as: registrar = "CSC CORPORATE DOMAINS, INC."

    that I can use to create objects in the app. What I'm creating is just a java-based plug-in. I just don't know how to parse the WHOIS text.

    Hope that helps, I'm kind of a Java beginner.

    Thanks again!

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Problem parsing WHOIS date from text and capturing fields

    Registrar: CSC CORPORATE DOMAINS, INC.
    There are methods in the String class that you could use to find this line and extract the data that you want from it.

  5. #5
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Problem parsing WHOIS date from text and capturing fields

    Thanks Norm... that leads me in the right direction! like I said, I'm a newbie and I needed some direction!

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Problem parsing WHOIS date from text and capturing fields

    Cross posted at Problem parsing WHOIS date from text and capturing fields - Dev Shed
    and
    Problem parsing WHOIS date from text and capturing fields - CodeGuru Forums

Similar Threads

  1. Get dynamic Text fields values
    By John kee in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 24th, 2011, 07:15 AM
  2. repeat creation of text fields
    By kurt-hardy in forum AWT / Java Swing
    Replies: 1
    Last Post: December 6th, 2010, 12:05 PM
  3. [SOLVED] Parsing a text file in java
    By tccool in forum What's Wrong With My Code?
    Replies: 13
    Last Post: November 16th, 2010, 05:23 AM
  4. Putting text fields in an array
    By Movies32 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 10th, 2010, 07:46 PM
  5. Text capturing from image
    By kishore in forum Java SE APIs
    Replies: 0
    Last Post: March 5th, 2010, 09:47 AM