echo "Start 2A25.20090401.64809.7.HDF 6420 6751"
echo "dimensions 9249 49"
echo "New Cell"
grep "6621,38" out.2A25.20090401.64809.7.HDF.txt.text = 36.58 7.52 77.82 210
grep "6623,41" out.2A25.20090401.64809.7.HDF.txt.text = 28.62 7.59 77.96 210
grep "6624,40" out.2A25.20090401.64809.7.HDF.txt.text = 33.74 7.52 77.96 210
grep "6624,41" out.2A25.20090401.64809.7.HDF.txt.text = 42.25 7.56 77.99 210
grep "6625,41" out.2A25.20090401.64809.7.HDF.txt.text = 30.58 7.54 78.02 210
grep "6627,40" out.2A25.20090401.64809.7.HDF.txt.text = 34.5 7.46 78.05 200
grep "6628,39" out.2A25.20090401.64809.7.HDF.txt.text = 35.57 7.40 78.05 200
grep "6628,40" out.2A25.20090401.64809.7.HDF.txt.text = 44.82 7.44 78.08 200
grep "6628,41" out.2A25.20090401.64809.7.HDF.txt.text = 21.35 7.47 78.11 210
grep "6629,40" out.2A25.20090401.64809.7.HDF.txt.text = 26.67 7.41 78.11 210
grep "6630,41" out.2A25.20090401.64809.7.HDF.txt.text = 28.12 7.43 78.17 210
grep "6631,40" out.2A25.20090401.64809.7.HDF.txt.text = 21.4 7.37 78.17 272
grep "6631,41" out.2A25.20090401.64809.7.HDF.txt.text = 47.3 7.41 78.20 200
grep "6631,42" out.2A25.20090401.64809.7.HDF.txt.text = 27.42 7.45 78.22 210
grep "6632,41" out.2A25.20090401.64809.7.HDF.txt.text = 39.42 7.39 78.23 200
grep "6632,42" out.2A25.20090401.64809.7.HDF.txt.text = 26.53 7.42 78.25 210
grep "6632,43" out.2A25.20090401.64809.7.HDF.txt.text = 27.72 7.46 78.28 210
grep "6632,44" out.2A25.20090401.64809.7.HDF.txt.text = 41.01 7.50 78.31 210
grep "6631,44" out.2A25.20090401.64809.7.HDF.txt.text = 34.26 7.52 78.28 210
grep "6632,45" out.2A25.20090401.64809.7.HDF.txt.text = 23.02 7.54 78.33 210
grep "6633,41" out.2A25.20090401.64809.7.HDF.txt.text = 32.5 7.36 78.26 272
grep "6633,42" out.2A25.20090401.64809.7.HDF.txt.text = 32.82 7.40 78.28 210
grep "6633,43" out.2A25.20090401.64809.7.HDF.txt.text = 39.28 7.44 78.31 210
grep "6634,41" out.2A25.20090401.64809.7.HDF.txt.text = 26.09 7.34 78.29 272
grep "6634,42" out.2A25.20090401.64809.7.HDF.txt.text = 41.54 7.38 78.31 210
grep "6634,43" out.2A25.20090401.64809.7.HDF.txt.text = 42.26 7.42 78.34 210
grep "6635,42" out.2A25.20090401.64809.7.HDF.txt.text = 31.53 7.36 78.34 210
grep "6635,43" out.2A25.20090401.64809.7.HDF.txt.text = 34.19 7.40 78.37 210
grep "6636,43" out.2A25.20090401.64809.7.HDF.txt.text = 29.9 7.37 78.40 292
echo "New Cell"
grep "6622,14" out.2A25.20090401.64809.7.HDF.txt.text = 22.24 6.61 77.22 291
grep "6622,15" out.2A25.20090401.64809.7.HDF.txt.text = 29.63 6.65 77.25 291
grep "6623,15" out.2A25.20090401.64809.7.HDF.txt.text = 30.63 6.63 77.28 291
echo "New Cell"
grep "6630,45" out.2A25.20090401.64809.7.HDF.txt.text = 31.44 7.59 78.27 292
echo "New Cell"
grep "6646,47" out.2A25.20090401.64809.7.HDF.txt.text = 27.52 7.31 78.81 210
grep "6647,47" out.2A25.20090401.64809.7.HDF.txt.text = 38.67 7.29 78.84 210
grep "6648,47" out.2A25.20090401.64809.7.HDF.txt.text = 37.08 7.27 78.87 210
echo "New Cell"
My Text file is shown above. The Column5 is the value that I am interested. In the last line posted above, its value is 37.08.
I want to retain only the groups (which are separated by echo "New Cell") in which at least one value is >=35
I tried:
awk '$5>=35 || /New Cell/ || /Start/ || /dimen/ || /Done/ || /End/' \
CWoSpix.apr2009.sh*
But it is removing all the lines in which 5th column value is <35.
The Expected Output is:
echo "Start 2A25.20090401.64809.7.HDF 6420 6751"
echo "dimensions 9249 49"
echo "New Cell"
grep "6621,38" out.2A25.20090401.64809.7.HDF.txt.text = 36.58 7.52 77.82 210
grep "6623,41" out.2A25.20090401.64809.7.HDF.txt.text = 28.62 7.59 77.96 210
grep "6624,40" out.2A25.20090401.64809.7.HDF.txt.text = 33.74 7.52 77.96 210
grep "6624,41" out.2A25.20090401.64809.7.HDF.txt.text = 42.25 7.56 77.99 210
grep "6625,41" out.2A25.20090401.64809.7.HDF.txt.text = 30.58 7.54 78.02 210
grep "6627,40" out.2A25.20090401.64809.7.HDF.txt.text = 34.5 7.46 78.05 200
grep "6628,39" out.2A25.20090401.64809.7.HDF.txt.text = 35.57 7.40 78.05 200
grep "6628,40" out.2A25.20090401.64809.7.HDF.txt.text = 44.82 7.44 78.08 200
grep "6628,41" out.2A25.20090401.64809.7.HDF.txt.text = 21.35 7.47 78.11 210
grep "6629,40" out.2A25.20090401.64809.7.HDF.txt.text = 26.67 7.41 78.11 210
grep "6630,41" out.2A25.20090401.64809.7.HDF.txt.text = 28.12 7.43 78.17 210
grep "6631,40" out.2A25.20090401.64809.7.HDF.txt.text = 21.4 7.37 78.17 272
grep "6631,41" out.2A25.20090401.64809.7.HDF.txt.text = 47.3 7.41 78.20 200
grep "6631,42" out.2A25.20090401.64809.7.HDF.txt.text = 27.42 7.45 78.22 210
grep "6632,41" out.2A25.20090401.64809.7.HDF.txt.text = 39.42 7.39 78.23 200
grep "6632,42" out.2A25.20090401.64809.7.HDF.txt.text = 26.53 7.42 78.25 210
grep "6632,43" out.2A25.20090401.64809.7.HDF.txt.text = 27.72 7.46 78.28 210
grep "6632,44" out.2A25.20090401.64809.7.HDF.txt.text = 41.01 7.50 78.31 210
grep "6631,44" out.2A25.20090401.64809.7.HDF.txt.text = 34.26 7.52 78.28 210
grep "6632,45" out.2A25.20090401.64809.7.HDF.txt.text = 23.02 7.54 78.33 210
grep "6633,41" out.2A25.20090401.64809.7.HDF.txt.text = 32.5 7.36 78.26 272
grep "6633,42" out.2A25.20090401.64809.7.HDF.txt.text = 32.82 7.40 78.28 210
grep "6633,43" out.2A25.20090401.64809.7.HDF.txt.text = 39.28 7.44 78.31 210
grep "6634,41" out.2A25.20090401.64809.7.HDF.txt.text = 26.09 7.34 78.29 272
grep "6634,42" out.2A25.20090401.64809.7.HDF.txt.text = 41.54 7.38 78.31 210
grep "6634,43" out.2A25.20090401.64809.7.HDF.txt.text = 42.26 7.42 78.34 210
grep "6635,42" out.2A25.20090401.64809.7.HDF.txt.text = 31.53 7.36 78.34 210
grep "6635,43" out.2A25.20090401.64809.7.HDF.txt.text = 34.19 7.40 78.37 210
grep "6636,43" out.2A25.20090401.64809.7.HDF.txt.text = 29.9 7.37 78.40 292
echo "New Cell"
echo "New Cell"
grep "6630,45" out.2A25.20090401.64809.7.HDF.txt.text = 31.44 7.59 78.27 292
echo "New Cell"
grep "6646,47" out.2A25.20090401.64809.7.HDF.txt.text = 27.52 7.31 78.81 210
grep "6647,47" out.2A25.20090401.64809.7.HDF.txt.text = 38.67 7.29 78.84 210
grep "6648,47" out.2A25.20090401.64809.7.HDF.txt.text = 37.08 7.27 78.87 210
echo "New Cell"
How can awk can be used to get the desired output?
grep "6630,45" out.2A25.20090401.64809.7.HDF.txt.text = 31.44 ...
appear in the output as it does not fit the condition$5>=35
? Elaborate your outputgrep
are wrong. It looks like you're trying to summarise the results of many grep commands on one file. if so, you'd be better off writing an awk script to do that job and summarise the results. This is looking like an XY Problem.