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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:28:46+00:00 2026-05-30T19:28:46+00:00

My input text is in this format aa5b r1 12715 r2 12221 aa43b ew

  • 0

My input text is in this format

 aa5b    r1     12715
 r2     12221
 aa43b   ew     13721
 eb     122331
 aa4b    ff     1055440

Output must be

aa5    r1     12715
r2    12221
aa43   ew     13721
eb  122331
aa4    ff     1055440

I tried with

 awk -F " " '{print $1}' t1 | grep "^aa*" > t2|sed s/b//g t2

The problem with this code is that the input text is not having a fixed pattern.

  • 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-05-30T19:28:48+00:00Added an answer on May 30, 2026 at 7:28 pm

    What about this version with sed?

    sed 's/^\(aa[0-9]*\)b/\1/' t1 > t2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've got a text input that get's date & time in this format:
I have this input text: <html><head><meta http-equiv=content-type content=text/html; charset=utf-8></head><body><table cellspacing=0 cellpadding=0 border=0 align=center width=603>
Please check the codes.. $(.editable).live(click,function(){ CurrentOBJhtml = $(this).text(); nextHtml = <input type='text' class='hoverable' value='+CurrentOBJhtml+'
var currentClassName = $(this).parent('td').next('td').find('input:text').attr('class'); if (currentClassName == undefined) { currentClassName = $(this).parent('td').find('input:text').attr('class'); } This
I created this layout of successive text input fields, 1- Enter data into empty
I have a text input : <input type=text onkeydown=processText(this) /> I have a processing
I am parsing data from this XML url The text input varies, depending on
I am trying to automate the creation of something like this: <input type='text' name='asdf[]'
I have form like this: <div class=satu> <input type='text' size='1' maxlength='1' name='score[1][]' id='score[1][]'> </div>
To be specific, I'm talking about avoiding this type of code: <input type='text' id='title_33'

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.