Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Using sed, how can I remove lines with salaries ending 500?

Input file:

Steve Blenheim:238-923-7366:95 Latham Lane, Easton, PA 83755:11/12/56:20300
Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA 91464:6/23/23:14500
Igor Chevsky:385-375-8395:3567 Populus Place, Caldwell, NJ 23875:6/18/68:23400
Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI 23874:3/28/45:245500
Jennifer Cowan:548-834-2348:583 Laurel Ave., Kingsville, TX 83745:10/1/35:58900
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Use this:

sed '/500$/d' filename

Or with grep:

grep -v 500$ filename

The $ denotes end of line. Also, the ^ character denotes the beginning of line. ^$ denotes a blank line.

share|improve this answer
    
Works great! Thank you jftuga for the explanations ... –  Steve Oct 8 '12 at 21:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.