bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Processing a file into smaller chunks


From: Javier Montoya
Subject: Processing a file into smaller chunks
Date: Tue, 04 May 2010 15:48:47 -0000
User-agent: G2/1.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]