I have multiple .txt files that contain multiple lines similar to this:
[class1] 1:-28 9:-315 13:-354227 2:-36.247 17:-342 8:-34 14:-3825
[class2] 14:-31.8679 7:-32.3582 2:-32.4127 1:-32.7257 8:-32.9804 16:-33.2156
I want to know how to read the numbers before the :s and store them in an array.
I would use regex but here is a version without, clearer than @Thrustmaster’s solution imo.