Hello Larz60+... thx for your help and for the script... it worked here with the test file (test.txt) however, when I used the real file (download link for the real file --> https://drive.google.com/open?id=1VqpMrd...JhYMjbwAGY) , it returned an error, as you can see below...
Traceback (most recent call last):
File "C:\Users\Administrador\Desktop\MSL\extractor2.py", line 31, in <module>
read_file('teste2.txt')
File "C:\Users\Administrador\Desktop\MSL\extractor2.py", line 20, in read_file
print(f"name: {nline[0]}, year: {nline[1]}")
IndexError: list index out of range
If you check the real file you will see 44 'DOSIMETRY_TOTAL_DOSE' blocks are spread along the entire file with a lot of info among them that should be discarded for the output file.
I'm right now trying to change your code but I still in need of help.
Thank you... best regards, Chuck
Traceback (most recent call last):
File "C:\Users\Administrador\Desktop\MSL\extractor2.py", line 31, in <module>
read_file('teste2.txt')
File "C:\Users\Administrador\Desktop\MSL\extractor2.py", line 20, in read_file
print(f"name: {nline[0]}, year: {nline[1]}")
IndexError: list index out of range
If you check the real file you will see 44 'DOSIMETRY_TOTAL_DOSE' blocks are spread along the entire file with a lot of info among them that should be discarded for the output file.
I'm right now trying to change your code but I still in need of help.
Thank you... best regards, Chuck