Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Get min and max value in column

$
0
0
Gents,

I have a big file file like this.

Code:

5100010002
5100010004
5100010006
5100010008
5100010010
5100010012
5102010002
5102010004
5102010006
5102010008
5102010010
5102010012

The file is sorted and I would like to find the min and max value, taking in the consideration key1 (substr$0,1,5) and key2 substr($0,6,5)

I would like to get something like this

Code:

51000 10002 10012
51020 10002 10012

Thanks for your help


Moderator's Comments:
Please wrap all code, files, input & output/errors in CODE tags
It makes them easier to read and preserves multiple spaces in case they are important.

Viewing all articles
Browse latest Browse all 16232

Trending Articles