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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:47:35+00:00 2026-06-16T23:47:35+00:00

My file has this structure: HELLO h e l lo HELLO(2) h ee l

  • 0

My file has this structure:

    HELLO h e l lo
    HELLO(2) h ee l lo
    HELLOMUM h e l ll m um
    HELLO-FATHER h e llo fa th er
    HOME h o m e
    HONEY h o ne y
    HONEY(2) ho nei y
    HONEY(3) h o ney
    HONEYMOON ho ney m o o n
    HONEY-MOON h o ne y moo n

I would like, while looking for the word HELLO, for example, to extract only the lines relatives to the words HELLO and HELLO(2). Same thing if I am looking for the word HONEY, I would like to have only the lines relative to HONEY, HONEY(2) and HONEY(3).
I am using

grep -w "HELLO" file.txt

but this gives me back for HELLO, for example, also the lines relative to HELLOMUM and HELLO-FATHER.

Thank you in advance.

  • 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-16T23:47:37+00:00Added an answer on June 16, 2026 at 11:47 pm

    I guess this should work for you.

    grep '^HELLO[^a-zA-Z]' your_file
    

    tested below:

    > grep '^HELLO[^a-zA-Z\-]' temp
    HELLO h e l lo
    HELLO(2) h ee l lo
    > grep '^HONEY[^a-zA-Z\-]' temp
    HONEY h o ne y
    HONEY(2) ho nei y
    HONEY(3) h o ney
    > 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My CSV file has this structure title;firstName;lastName;email; Sir;Bob;Public;bob.p@gmail.com; The first row shows the column
Lets say my structure is like this /-- am here /one/some/dir /two /three/has/many/leaves /hello/world
I have a text file which has the following structure: 341|18 Hello world|20090225230048AAnhStI|90|$0.30|10|289|2|2|2|Is that
my text file has this structure and this values 15.32 15.00 14.58 14.36 17.85
I have a Java project which has this file structure (shown in Eclipse): ProjectName
I have a file called file.txt and it has this structure: owner_name : first_last_name
I've got a .js file that has this function in it: function showDialog(divID) {
My file has a lot of line breaks, like this: This is a line.
This is a forked problem off of this question: flac: "ERROR: input file has
My app uses an API from an external JAR file. This JAR file has

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.