Computing.Net > Forums > Unix > can I use grep command??

can I use grep command??

Reply to Message Icon

Original Message
Name: Mai
Date: September 28, 2005 at 06:55:41 Pacific
Subject: can I use grep command??
OS: UNIX
CPU/Ram: 508 MRAM
Comment:

Hi!
I have the text :
...HRD 20050905
820 N Final technical
820HRD
If I want to remove only the line with "...HRD". Please some one know how and which the command on shell script to remove that? Is it grep. thanks advanced

mai_vo_41


Report Offensive Message For Removal


Response Number 1
Name: nails
Date: September 28, 2005 at 14:08:03 Pacific
Reply: (edit)

One way is to use sed to delete the line:

sed '/^\.\.\.HRD/d' myfile.txt

That is, delete a line that starts with 3 periods and string "HRD".


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: can I use grep command??

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge