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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:09:36+00:00 2026-06-11T01:09:36+00:00

As a quite new Linux user I never (really) used tools such as sed

  • 0

As a quite new Linux user I never (really) used tools such as sed and awk (or any others) to parse text.
I want to extract from

Speed : 1624.127424 Kib/s in 9.410000 seconds

the time value in second, just before the seconds word ,

Which tool should I look into for this ?

  • 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-11T01:09:37+00:00Added an answer on June 11, 2026 at 1:09 am

    There are a number of tools you could use, but awk will do fine:

    echo "Speed : 1624.127424 Kib/s in 9.410000 seconds" | awk '{print $6}'
    

    or (if your data is in a file):

    awk '{print $6}' data.txt
    

    gives you

    9.410000
    

    Explanation:

    This assumes that the relative position of the value you are interested in on the line will stay the same (and in this case be the 6th white-space separated field), adjust accordingly.

    awk splits the input line up into fields based on white-space. The field you are interested in is the 6th field, so you are printing that with $6.

    Alternatively, you could have also used awk '{print $(NF-1)}' to print the next-to-last field on the line (NF is an awk variable that knows the number of fields on a given line). This offers a bit more flexibility as it would work with an length line (ie number of fields) as long as the field you were interested in was next-to-last).

    —

    cut would be another tool that would work too:

    echo "Speed : 1624.127424 Kib/s in 9.410000 seconds" | cut -d' ' -f 6
    

    in this case, the line is split based on the delimiter of space (as specified by -d) and again, we are interested in the 6th field (-f 6).

    There are other ways too, but these two seem straight forward and came to mind first.

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

Sidebar

Related Questions

I am quite new to the embedded linux programming and did not really understand
I'm quite new to Android programming but familiar with C/C++ and Linux enough to
everyone. I'm quite new here so please be tolerant if I make any mistakes.
I'm new to linux kernel programming, and for quite a long time I'm trying
I'm quite new to Linux programming. I'm compiling a simple C++ code using g++
I'm a new Linode/Linux user running Debian 6. I'm trying to get my Unicorn
I'm quite new to programming for Linux. You could say I'm a Windows guy.
I am quite new to linux development, and having trouble using a class from
Quite new to maven here so let me explain first what I am trying
Im quite new to spring mvc. What I'm trying to achive is separating static

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.