Created
December 28, 2022 04:48
-
-
Save eddiez9/2b143adaeaff9f8e003b0e8b088c549b to your computer and use it in GitHub Desktop.
Parses putty NAND dump log for information we care about
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
with open('dump.log') as file: | |
save = False | |
for line in file: | |
# Do we save this line? | |
if line.isspace(): | |
continue | |
elif ("------------------ block: 1117" in line): | |
save = False | |
continue | |
elif ("------------------ block:" in line): | |
save = True | |
continue | |
elif ("----------- spare area for block" in line): | |
save = False | |
continue | |
elif ("*** command status = 1" in line): | |
break | |
# Checking if we should save this line | |
if save == True: | |
print(line, end="") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment