Last active
May 12, 2022 18:39
-
-
Save michaelcoyote/226795ff2c089fe29982 to your computer and use it in GitHub Desktop.
Dumb sed trick for converting GB/MB to bytes..
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dumb sed trick for converting GB/MB to bytes.. | |
# awk would be better for detail work as you can do math | |
sed 's/\.[0-9] GB/000000000/' Raw_Status.csv |sed 's/\.[0-9] MB/000000/' | sed 's/0\ bytes/0/' > Cooked_Status.cvs |
Sure, this is a hack with sed to give you quick and dirty numbers to work with, please see line 2. YMMV, offer not valid in sectors R and N
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that this trick doesn't work when we are dealing with mebibytes = 1024 * 1024 bytes (which is different than the megabyte because that is defined as 1000 * 1000 bytes)