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

  • Home
  • SEARCH
  • 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 4081286
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:02:29+00:00 2026-05-20T18:02:29+00:00

I have a file which has blank lines but the following sed command is

  • 0

I have a file which has blank lines but the following sed command is not working:

sed -e 's/#.*//' -e '/^END/ d' -e '/^>/ d' -e '/^$*/ d' auto.txt > a.txt

It works but when I add the blank line thing it removes everything and i get empty file

Sample

auto.txt

>#begin wildfire_pdm_x10
#wildfire_test server pdml x10 mode=PDM_MDHTASM clean_cache
proe_wfpdmo_wsabar_pdmactions+PDM_MDHTASM+wfpdmo_wsabar_pdmactions.txt@proe.wfpdmo_wsabar_pdmactions
END
#wildfire_test server pdml x10 mode=PDM_MDTTB clean_cache
proe_wfpdmo_wstbar_pdmactions+PDM_MDTTB+wfpdmo_wstbar_pdmactions.txt@proe.wfpdmo_wstbar_pdmactions
END

output needed

a.txt

proe_wfpdmo_wsabar_pdmactions+PDM_MDHTASM+wfpdmo_wsabar_pdmactions.txt@proe.wfpdmo_wsabar_pdmactions

proe_wfpdmo_wstbar_pdmactions+PDM_MDTTB+wfpdmo_wstbar_pdmactions.txt@proe.wfpdmo_wstbar_pdmactions
proe_wfpdmo_pdm_matfnc_b+PDM_MTLFNC+wfpdmo_pdm_matfnc_b.txt@proe.wfpdmo_pdm_matfnc_b
proe_wfpdmo_proe_resparam+PDM_PARM+wfpdmo_proe_resparam.txt@proe.wfpdmo_proe_resparam
proe_wfpdmo_proe_restrparam+PDM_PARM+wfpdmo_proe_restrparam.txt@proe.wfpdmo_proe_restrparam
proe_wfpdmo_proe_restrparam_b+PDM_PARM+wfpdmo_proe_restrparam_b.txt@proe.wfpdmo_proe_restrparam_b
proe_wfpdmo_proe_restrparam_b+PDM_PARM+wfpdmo_proe_restrparam_b_2.txt@proe.wfpdmo_proe_restrparam_b
  • 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-20T18:02:29+00:00Added an answer on May 20, 2026 at 6:02 pm

    you can use awk

    $ awk 'NF && !/^(>|END)/ && !/#.*/' file
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an excel file which has more than 65536 rows. However, I can
I have an index.php file which has to process many different file types. How
I have a product which has been traditionally shipped as an MSI file. It
I have a txt file which actually is a html source of some webpage.
I have an Excel file (which has data imported from Oracle 10G Database) one
I have a zip file which has one base folder inside it with other
I have a big (1.9 GB) XML file which has data I want to
I have a flat CSV file which I need read from to end up
I have a file which is an XML representation of some data that is
I have a .rc file which is used to include some text data in

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.