Dear all, I'm a newbie with bash programming and I'm trying to process a file into smaller chunks. Let's say I've to process the file below ('X' and 'Y' are any possible float number):
0 0 0 0 0 0 0 0 0 0 0 0 X X X X X 1.70 0 0 0 0 0 0 X X X X X 1.60 0 0 0 0 0 0 X X X X X 1.30 Y Y Y Y Y 1.90 0 0 0 0 0 0 0 0 0 0 0 0 X X X X X 2.10 The lines containing 0’s can be thought as being delimiters. I need to find between the delimiters, which line has the highest value in the last column (column#6), and, just output the corresponding line. Does anybody could shed some light on it? An example of the desired output would be: X X X X X 1.70 X X X X X 1.60 Y Y Y Y Y 1.90 X X X X X 2.10 Is it possible to obtain such a result using bash scripting? Best regards