I have (multiple) files like below list. Few of them has both the values in TB and couple of files in GB. Now if you clearly see the file output there are two rows with Total capacity and Capacity used. I can do this with awk to add up both the rows separately but I see few are in GB. Would it be possible to write script which will check if values are in GB or TB, if it's in GB then convert to TB (1024).
[root@localhost maneesh]# cat server1.txt Total capacity 2.0 TB Capacity used 735.23 GB [root@localhost maneesh]#
Basically, at the end I want all my values to be presented in TB.
Any help on this would be appreciated.