Need help in finding minimum and maximum values from a text file. With the help two codes, one from 'BASH' and one from

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Need help in finding minimum and maximum values from a text file. With the help two codes, one from 'BASH' and one from

Post by answerhappygod »

Need help in finding minimum and maximum values from a
text file. With the help two codes, one from 'BASH' and one
from 'PYTHON'.
Description: I have a file named 'abc.log'. It has different
texts, however, in one portion it has a column named 'ifmax'. I
need to find the maximum and minimum values of this column only.
For this purpose, both the codes from bash and python are
required.
Need Help In Finding Minimum And Maximum Values From A Text File With The Help Two Codes One From Bash And One From 1
Need Help In Finding Minimum And Maximum Values From A Text File With The Help Two Codes One From Bash And One From 1 (258.44 KiB) Viewed 46 times
3.141593 39: 42 : 43: 44 : 48 : Need to know the minimum and maximum values of this column (ifmax) File name: abc.log 35 : 0 1 0 -1 -1 -1 1 0 0.000000 0.000000 3.141593 36 : 1 1 1 0 -1 -1 -1 0.000000 0.000000 37 : 1 0 -1 -1 -1 0 © 1 11 0.000000 3.141593 e.oeoseo 38 : @ 1 0 1 1 0 1 1 0 0 0 0.000000 0.000000 e.eeeeee 0 1 0 0 0 1 -1 -1 -1 1 1 3.141593 0.000000 0.000000 40 : -1 -1 -1 1 0 1 1 0 1 ??? 0.000000 0.000000 3.141593 . 1 41 : 1 1 1 1 0 -1 0-1 0 1 0 © 0.000000 0.000000 3.141593 “。 0-1 -1 0 -1 0 0.000000 0.000000 0.000000 -1 0-1 1 1 1 1 1 1 0.000000 3.141593 0.000000 " 0-1 0 1 1 1 1 1 -1 3.141593 0.000000 0.000000 45 : 0-1 0-1 1 1 1 1 res 3.141593 0.000000 " 0.000000 46 : 1 1 1 1 -1 0 © © -1 0.000000 3.141593 0.000000 47 : -1 @ 0 @ -1 -1 @ * 0.000000 0.000000 0.000000 -1 @ 1 1 1 © -1 0.000000 0.000000 . 3.141593 ====== K-POINTS ===== Number of k-points: 1728 Number of bands: 100 k-grid: 12 12 12 k-shifts: 0.470000 0.370000 0.320990 occupied band, ifmax = highest occupied band, for each spin] Coordinates (crystal) Weight Number of G-vectors - 1 0.039167 2016 0.030833 0.026667 0.000579 1355 1 2 0.039167 2017 0.030833 0.110000 0.000579 1332 1 2016 3 0.039167 192222 0.030833 0.193333 0.000579 1222 1333 1 4 2012 0.030833 a ezagaa @ 0.000579 1224 1334 1 5 2002 0.039167 0.030833 0.000579 1337 1337 1 6 0.039167 0.030833 0.443333 0.000579 1327 1327 1 7 0.039167 0.030833 0.526667 0.000579 1335 1 8 12 0.039167 0.030833 0.610000 0.000579 1325 1 *** * *** 9 0.039167 *** 0.030833 0.693333 0.000579 1333 1 .2.0, 1055 * 10 0.039167 0.030833 0.776667 0.000579 1334 1 4 *** *** 11 0.039167 0.030833 0.860000 0.000579 1331 1 * 1221 12 0.039167 0.030833 0.943333 0.000579 1332 1 uc ce 1222 13 0.039167 0.114167 0.026667 0.000579 1330 1 20402 2010 14 4000 2004 0.039167 ®.114167 Ⓡ.110000 0.000579 1327 1 15 *** 0.039167 0.114167 ©.193333 0.000579 1330 1 16 0.039167 0.114167 0.276667 0.000579 1335 1 17 0.039167 0.114167 0.360000 0.000579 1328 1 In bash (ifmin = lowest Index ifmin ifmax 9 In python 0.276667 0.360000 10 11 12 12 12 12 12 12 12 11 10 10 10 12 12 12
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply