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!

Deleting selective Multiple Lines

Status
Not open for further replies.

pavithra123

IS-IT--Management
Jun 17, 2001
54
CZ
Hi all,

I have a file with entries like below
0000000000000070000
0000000000000800000
0000000000000009000
0000000000000000000
0000000000000060000.

I am using sed to separate these entries

in the sed commands template file I have entries like below

/00000070000/!d
/00000060000/!d

assuming that this will delete other lines except
0000000000000070000
0000000000000060000.

But this is not happening because this entry /00000070000/!d
will delete other entries also.

so i put the braces like
{
/00000070000/!d
/00000060000/!d
} but still the same result. So How do I get only 0000000000000070000
0000000000000060000 enties separately.

any help is greatly appreciated.

Best Regards
Prem.


 
The whole Idea is to separate them into a different directory.
 
Am I missing something here? Use grep and redirect the output (with >) to wherever you want the output.
 
first entry:
/00000070000/!d
deleted everything including the lines like:
0000000000000060000
stayed only lines like:
0000000000000070000
however that one (with 7) you deleted with next command:
/00000060000/!d
and you obtained ... nothing!
try regular expression like:
/000000[67]0000/!d
should help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top