Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 12-02-2005, 10:27 AM   #1
LQ Newbie
Registered: Nov 2005
Location: Belgium
Distribution: Slackware 10.1 - Suse 9.1
Posts: 4

Rep: Reputation: 0
Grab text lines in text file

How can i grab text lines NOT beginning by # in a text file with the sed command

Old 12-02-2005, 10:55 AM   #2
Andrew Benton
Senior Member
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
sed -n '/^#/!p' text-file


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 11:28 AM
adding text to lines in a file tpreitano Linux - General 2 10-04-2005 09:30 AM
Remove odd lines from a text file Mr. Gone Programming 2 09-19-2005 11:16 AM
How to filter lines from a text file Rascale Linux - Software 1 10-28-2003 12:46 PM
Loop over lines in text file? amaze Linux - General 2 08-12-2003 07:15 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:27 PM.

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