Hello, I'm reading a large file line by line and I need to know if certain positions are greater than 0 if not, I don't want to print that line, it should then go to the next line. Example of line below.
Would each position need to be assigned to a variable and then summed or is there a better way? If someone could point me in the right direction. Thanks!
Output:000002250000000000089877000000000000.0002/28/202000000000.00000004698.45
for line in mf.readlines(): if(line[164:171] > 0) ....then print else next lineSo if 4698.45 > 0
Would each position need to be assigned to a variable and then summed or is there a better way? If someone could point me in the right direction. Thanks!
Larz60+ write Nov-05-2020, 02:29 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Added for you this time, please use in all future posts,
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Added for you this time, please use in all future posts,