Re: read min line number from a file
From: mgrd (mgrd_at_gmx.net)
Date: 12/20/03
- Next message: mgrd: "Re: read min line number from a file"
- Previous message: jfuture_99_at_yahoo.com: "read min line number from a file"
- In reply to: jfuture_99_at_yahoo.com: "read min line number from a file"
- Next in thread: mgrd: "Re: read min line number from a file"
- Reply: mgrd: "Re: read min line number from a file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 20 Dec 2003 22:09:09 +0100
jfuture_99@yahoo.com wrote:
[..]
> For example, I want get line number that matchs "new customer" patter
> from a file "record.a". I do this:
>
> grep -n -i "new customer" record.a | cut -d: -f1
>
> It will give a lot of line numbers, 12, 111, 123, .... All I want is
> the smallest number that is 12. How can I do that?
grep -n -i "new" customer record.a | cut -d: -f1 | sort -n | head -1
- Next message: mgrd: "Re: read min line number from a file"
- Previous message: jfuture_99_at_yahoo.com: "read min line number from a file"
- In reply to: jfuture_99_at_yahoo.com: "read min line number from a file"
- Next in thread: mgrd: "Re: read min line number from a file"
- Reply: mgrd: "Re: read min line number from a file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]