LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-15-2004, 03:39 AM   #1
kakho
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Rep: Reputation: 0
How do i remove blank lines from a file?


just wanna ask everybody how to remove blank lines from a file?
and also how to strip off comments from a file.. for eg...
echo a test #this is a comment
also from the following code line:
echo \#this is not a comment #this is a comment

thanks for your help!!!
 
Old 04-15-2004, 03:57 AM   #2
profjohn
Member
 
Registered: Mar 2004
Location: Jinhua, People's Republic of China
Distribution: MDK, RH, KNPX
Posts: 161

Rep: Reputation: 30
You can use grep. Here is an example:

http://www.tech-recipes.com/modules....cipes&rx_id=67
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove odd lines from a text file Mr. Gone Programming 2 09-19-2005 11:16 AM
How to remove lines from a file doza Linux - General 2 04-27-2005 11:59 AM
remove identical lines in a file benjithegreat98 Linux - General 4 04-24-2004 06:12 AM
[bash] remove lines from a file Drimo Programming 3 03-20-2004 11:16 AM
Replace blank/almost blank lines in file Wynd Linux - General 3 01-27-2004 04:49 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration