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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:04:58+00:00 2026-06-14T07:04:58+00:00

I have an input like following. Curveplot Time Maxima of Curve Part no. 13

  • 0

I have an input like following.

Curveplot
Time
Maxima of Curve
Part no.
13 #pts=2
* Minval=   0.000000e+000 at time=        0.000000
* Maxval=   2.237295e+000 at time=        0.001000
   0.000000e+000       0.000000e+000
   9.999999e-004       2.237295e+000
endcurve

I want to take get the maximum value out of this file, which is the value after Maxval

* Maxval=   2.237295e+000 

Can someone suggest how to do it with linux sed ?
My output would only be the number 2.237295e+000.

  • 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-14T07:04:59+00:00Added an answer on June 14, 2026 at 7:04 am

    Using the following one-liner will only display 2.237295e+000

    sed -nr 's/.*Maxval= *([^ ]*).*/\1/p'

    Regex:

    Match:
    .*      # match any characters
    Maxval= # upto 'Maxval='
     *      # match multiple spaces (that is a space followed by *)
    ([^ ])  # match anything not a space, use brackets to capture (save this) 
    .*      # match the rest of line
    
    Replace with:
    \1      # the value that a was captured in the first set of brackets. 
    

    So effectively we substitute the whole line containing the word Maxval= by the value of Maxval.

    Note: depending on the platform and/or implementation of sed the you may need to use -E instead of -r.

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

Sidebar

Related Questions

I have some html like the following: <div class=control-group> <input type=text data-bind=value: $data.DealCode name=DealCode
I have code that looks like the following: <form id=MyForm name=MyForm method=post action=index.php> <input
I have a structure like the following: <form> <input type=text /> <input type=text />
I have something like the following <div id=container> <ul id=name_list> <li class=name> <input type=hidden
Assume I have the following input in Pig: some And I would like to
I would like to have some input on the following: I would like some
I have an input mask on my text box like 000,000,000.00 I have the
I have input like following snippet, Input Snippet : <div class=a> <table> <col width=4
If I have a few checkboxes like the following: <input type=checkbox onchange=foo(bar); /> Bar
I have some input that looks like the following: A,B,C,"D12121",E,F,G,H,"I9,I8",J,K The comma-separated values can

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.