Mar-22-2023, 02:42 AM
I have a file and I figured out how to extract and strip the line per line data I need from it but...I end up with the numbers representing individual colors like this:
White (2), 150, 151, 310, 319, 333, 340, 341, 600, 602, 603, 640, 645, 648, 680, 745, 754, 758, 779, 819, 829, 838, 948, 991, 3042, 3072, 3743, 3778, 3812, 3821
I need to add up how many color numbers there are and I am having trouble with the ones with (x) part. Each number represents 1 of a color except if it has a (x) where the number is x instead of 1.
I have been programming since 1976 in BASIC, Qbasic, Visbasic, MASM and perl but have been on hiatus since 2002 so new to Python.
Any help is appreciated.
Thank you,
hwolff1962
White (2), 150, 151, 310, 319, 333, 340, 341, 600, 602, 603, 640, 645, 648, 680, 745, 754, 758, 779, 819, 829, 838, 948, 991, 3042, 3072, 3743, 3778, 3812, 3821
I need to add up how many color numbers there are and I am having trouble with the ones with (x) part. Each number represents 1 of a color except if it has a (x) where the number is x instead of 1.
I have been programming since 1976 in BASIC, Qbasic, Visbasic, MASM and perl but have been on hiatus since 2002 so new to Python.
Any help is appreciated.
Thank you,
hwolff1962