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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:40:35+00:00 2026-06-17T10:40:35+00:00

I try to extract a particular pattern from a file. the file content: ——–some

  • 0

I try to extract a particular pattern from a file. the file content:

--------some other command in here----------
<tr>
<td>someWords</td>
<td>anotherWords</td>
</tr>
--------some other command in here-----------
the <tr>...</tr> patter occur again

I try to extract the tr pattern from the file

in the shell script I write:

read INPUT

grep '<tr>\n<td>[A-Za-z0-9,<,>,/]</td>\n<td>[A-Za-z0-9,<,>,/]</td>\n</tr>

However, this command doesnt work. Any idea? thx

  • 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-17T10:40:36+00:00Added an answer on June 17, 2026 at 10:40 am
     sed -n '/<tr>/,/<\/tr>/p' file
    

    see example:

    kent$  cat a                      
    --------some other command in here----------
    <tr>
    <td>someWords</td>
    <td>anotherWords</td>
    </tr>
    --------some other command in here-----------
    the 
    <tr>
    <td>someOtherWords</td>
    <td>anotherWords2</td>
    </tr>
    
    kent$  sed -n '/<tr>/,/<\/tr>/p' a
    <tr>
    <td>someWords</td>
    <td>anotherWords</td>
    </tr>
    <tr>
    <td>someOtherWords</td>
    <td>anotherWords2</td>
    </tr>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ABCpdf to extract the text content of some PDF files, in particular
So I am currently using SAX to try and extract some information from a
I am using jtar-1.1 to try extract files from a tar file, im using
I use iText 5.3.3 I try to extract text from pdf file. I use
I try to download a zip file to android and then extract the zip
I have a KML file and I extract the last coordinates and try to
I try to extract specific data from an xml feed that comes from youtube.
When I try to extract a string from a larger string it gives me
I'm try to extract the INV part of the string below: 123_456_P1234_INV_UID-123456.PDF Here's the
I need to extract the text from the nodes in an html file 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.