Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8092117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:13:11+00:00 2026-06-05T20:13:11+00:00

Would like to parse IPv4 address from exit-addresses . Format of the file: ExitNode

  • 0

Would like to parse IPv4 address from exit-addresses. Format of the file:

ExitNode 006C3FA7C3F6E3ACD13D0DD9B10C7DFA933C237B
Published 2012-06-12 05:04:03
LastStatus 2012-06-12 06:03:22
ExitAddress 220.0.231.71 2012-06-12 10:23:05
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:13:12+00:00Added an answer on June 5, 2026 at 8:13 pm
    with open('data.txt') as inf:
        for line in inf:
            if line.startswith('ExitAddress'):
                print line.split()[1]
    

    will give you

    220.0.231.71
    

    where data.txt contains the four lines you posted (I also ran it with the big file you linked to). Using with will also “automagically” close your file for you when you are done, or an exception is encountered.

    This list comprehension will collect all of the data in a list for you once the data file has been opened:

       a = [line.split()[1] for line in inf if line.startswith('ExitAddress')]
    

    or alternatively, if you don’t want to collect the whole list in memory at once, you could use a generator expression:

       g = (line.split()[1] for line in inf if line.startswith('ExitAddress'))
    

    You’ll also have take care of closing the file yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to parse a self-designed file format with a FSM-like parser in
I have an interesting log file format and I would like to parse it
I have a file with a specific format that I would like to parse.
I would like to parse the folder name and file name from passed argument.
I would like to parse the values from aspx pages, both what is passed
Hey. I would like to upload a file and then parse it. Because parsing
I would like parse data from google maps geocode version 3 through json. I
I would like to parse this Gstring with groovy : Format type : Key,
For Background: I would like parse time and value from several (json) files and
I have a OPML file that I would like to parse the links and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.