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 8276563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:24:42+00:00 2026-06-08T08:24:42+00:00

I generated data from the netstat -a command in the terminal, now from there

  • 0

I generated data from the netstat -a command in the terminal, now from there the result is all the incoming and outgoing ip addresses which I wrote to a file, how to I retrieve only the ip address via columns?

Also, how do I retrieve data by column parameters? For example, starting at column 10 and ending at column 27. I have tried the filter function but it didn’t work. Thanks!

  • 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-08T08:24:43+00:00Added an answer on June 8, 2026 at 8:24 am

    This is basically the same as Levon’s answer, but slightly more compact and Pythonic, and with the numbers adjusted to a guess at what I suspect the OP is trying to do.

    with open('data.txt') as inf:
      for lc, line in enumerate(inf):  # lc - current line count
        if lc >= 2: # netstat usually has 2 lines of header info
          print ' '.join(line.split()[3:5]) # cols 3-4 are the addresses
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an h:dataTable with data generated from an ArrayList with custom object Result.
I generated script from old database, created a new database and imported all data
I am developing a Java based desktop application. There are some data generated from
I have millions of lines generated from data updated every second which look like
I need to model-bind data from textboxes generated dynamically on the client side (using
I have an application that displays the data from 3 xml files (auto generated
Created .NET WCF service, tested it - works. Generated schemas from Data and service
I attempt to use webservice return POCO class generated from entity data model as
I have created an entity data model and generated a database from it. One
I have a large set of data that is generated from a web service

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.