I am having some trouble creating logic for loop in python cause Ii am new to python, I do not have any idea of modules. So basically what I need here is a report which will calculate the total available capacity of all the similar hostname in the group Like Ka is one group Kb is another group kax-nfs is nfs share kbx-nfs is nfs second group. kax-clus is cluster and teh second group for cluster is kbx-clusEach group may have set of servers, which need be calculated like shown below. for each host the total line of output is 7 lines, for better understanding I have skipped the some-content. in some server its Total NFS volume size provisioned or kbx-hostn host Total LUN size provisioned (GB): but the ``Total available capacity (GB):` reaming the same.All kbx-hostn host Total available capacity (GB): should be addedAll kbx-hostn host Total LUN size provisioned (GB): should be added   eg:Total available - Total provisioned = actual available / 1024 = AnswerI am trying to do this in python.Required outputkbx-hostn 2.1 TB ----- > is the actual output I needRaw_Data*Netapp Cluster: kbx-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 20506.90------Some-content------------Total LUN size provisioned (GB): 18301.64------Some-content------------*Netapp Cluster: kbx-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 20506.90------Some-content------------Total LUN size provisioned (GB): 20500.71------Some-content------------*Netapp Cluster: kbx-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 20506.90------Some-content------------Total LUN size provisioned (GB): 17251.87------Some-content------------*Netapp Cluster: kbx-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 20506.90------Some-content------------Total LUN size provisioned (GB): 0------Some-content------------*Netapp Cluster: kbx-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 20506.90------Some-content------------Total LUN size provisioned (GB): 0------Some-content------------*Netapp Cluster: kax-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 20506.90------Some-content------------Total LUN size provisioned (GB): 19250.54------Some-content------------*Netapp Cluster: kax-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 20506.90------Some-content------------Total LUN size provisioned (GB): 19751.66------Some-content------------*Netapp Cluster: kax-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 20506.90------Some-content------------Total LUN size provisioned (GB): 6000.29------Some-content------------*Netapp Cluster: kax-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 20506.90------Some-content------------Total LUN size provisioned (GB): 0------Some-content------------*Netapp Cluster: kax-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 20506.90------Some-content------------Total LUN size provisioned (GB): 0------Some-content------------*Netapp Cluster: kax-nfshostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 6530.23Total NFS volume size provisioned (GB): 6144.00------Some-content------------------Some-content------------*Netapp Cluster: kbx-nfshostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 6530.23Total NFS volume size provisioned (GB): 5376.00------Some-content------------------Some-content------------*Netapp Cluster: kax-nfshostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 6530.23Total NFS volume size provisioned (GB): 512.00------Some-content------------------Some-content------------*Netapp Cluster: kax-nfshostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 6530.23Total NFS volume size provisioned (GB): 0------Some-content------------------Some-content------------*Netapp Cluster: kax-nfshostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 6530.23Total NFS volume size provisioned (GB): 0------Some-content------------------Some-content------------*Netapp Cluster: kbx-nfshostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 6530.23Total NFS volume size provisioned (GB): 0------Some-content------------------Some-content------------*Netapp Cluster: kbx-nfshostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 6530.23Total NFS volume size provisioned (GB): 0------Some-content------------------Some-content------------*Netapp Cluster: kbx-nfshostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 6530.23Total NFS volume size provisioned (GB): 0------Some-content------------------Some-content------------*Netapp Cluster: kbx-clushostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 202046.45Total NFS volume size provisioned (GB): 72383.24------Some-content------------------Some-content------------lo8nv-stmg0001n APP [11:35 AM]*Netapp Cluster: lax-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 13671.27------Some-content------------Total LUN size provisioned (GB): 13451.70------Some-content------------*Netapp Cluster: lax-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 13671.27------Some-content------------Total LUN size provisioned (GB): 12451.01------Some-content------------*Netapp Cluster: hbx-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 13671.27------Some-content------------Total LUN size provisioned (GB): 13300.87------Some-content------------*Netapp Cluster: hbx-hostn*------Some-content------------------Some-content------------------Some-content------------Total available capacity (GB): 13671.27------Some-content------------Total LUN size provisioned (GB): 11200.40------Some-content------------Bash script cat raw_data | sed '/^$/d' | sed '/^Total # of SVMs/d' | sed '/^Total IOPS/d'  | sed '/APP/d' |  sed '/^new/d' | sed '/^Total throughput/d'  |sed '/^\[/d'  | sed 's/\*Netapp Cluster://g' | sed '/^Total physical capacity /d'  | grep -A2  -e  ax-cluster -e bx-cluster | grep -v -e ^- -e ^$ | awk 'ORS=NR%3?FS:RS' | sort
Python loop for calculation
python