Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using sed to find the largest number in a muli-column file of numbers

rjsosiSep 3 2020 — edited Sep 5 2020

Hi,

We have a file of numbers about 10 columns wide.

The first 10 lines look line this:

$ head lenout

881 8 13 47 8 13 45 10 54 2

73 864 0 0 0 0 0 0 0 2

824 198 0 0 0 0 0 0 0 2

257 16 762 0 0 0 0 0 0 2

62 759 0 0 0 0 0 0 0 2

62 746 0 0 0 0 0 0 0 2

62 753 0 0 0 0 0 0 0 2

811 89 0 0 0 0 0 0 0 2

1045 8 13 53 0 0 0 0 0 2

831 10 56 0 0 0 0 0 0 2

The file is 349381 rows long. Is there a way to find the largest number in this file no matter what column?

I was thinking of using sort but I do not use sort that much.

So the output would be either just the largest number in the file or even the row that returns the largest number.

Thanks

Comments
Post Details
Added on Sep 3 2020
5 comments
1,638 views