Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SED to remove entries in a file

Status
Not open for further replies.

menace212

Programmer
Jul 11, 2003
144
US
How can I access a file in Unix and the use SED to remove certain entries in a program. For instance:

Software:

Entire Distrubution plus OEM support 1.2
64-bit iconv conversion for Eastern European locales 5.7
64-bit iconv conversion for Eastern European locales 5.7

ABI 1.0
ABI Application Certification Tools 5.8/on28-patch:01/118

Apache Web Server 1.3.9
Apache Web Server (root) 5.8/Generic
Apache Web Server (root) 5.8/Generic
Apache Web Server (root) 5.8/Generic


I want to remove the sub titles using sed. First I want access the file and then remove the sub titles with SED.
Any ideas?


open("tmp/software");
sed(????????????)




 
Something like this ?
Code:
sed '/^  /d' <tmp/software >tmp/software.new

Hope This Help
PH.
 
Thanks
Can you give me an unix script example how I would open the file then use the sed in it.

Ex.

open(&quot;/tmp/sofware&quot;)
sed '/^ /d' <tmp/software >tmp/software.new

Would this be the format?
 
Why open the file ? The sed command do it by itself.
 
As I see all needed lines start on the beginning of the line and all unneded lines contain some spaces on the beginning. Thus a simple grep would do:

cat tmp/software | grep -v &quot;^ &quot;

or something like that...

--Trifo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top