try.py 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env python
  2. import re
  3. from pprint import pprint
  4. for line in [
  5. ' 2 1950 100% - 1050 100% 2780 100%',
  6. ' 5 2800 100% - 2330 100% - 1230 100%',
  7. ' 8 2890 100% 1530 100% - 2310 100%',
  8. ' 9 - 2160 100% 2730 100% - 2120 100%',
  9. ' 324 - 2800 100% 2650 100% - 2490 100%',
  10. ' 492 990 100% 900 100% 1660 100%',
  11. ' 890 1920 100% - 2140 100% 1480 100%',
  12. ' 1229 - 2870 100% - 1266 90% 728 68%',
  13. ' 1643 - 3000 100% - 3000 100% - 3000 100%',
  14. ' 1683 - 1021 97% 1460 100% - 2620 100%',
  15. ' 1898 - 1600 100% - 1940 100% - 1860 100%',
  16. ' 2186 1220 100% - 900 100% - 1840 100%',
  17. ' 2194 2030 100% - 1460 100% - 1080 100%',
  18. ' 2577 2810 100% - 1550 100% - 2350 100%',
  19. ' 2629 2570 100% - 2270 100% - 1430 100%',
  20. ' 3659 - 1720 100% 1240 100% - 2760 100%',
  21. ' 3978 - 920 100% 2560 100% - 2590 100%',
  22. ' 4302 348 25% - 2530 100% - 316 23%',
  23. ' 4516 - 1231 60% - 1839 75% 7 0%']:
  24. work = line.replace('%', '')
  25. parts = re.split(r"(?<=\d)\s", work)
  26. print(work)
  27. pprint(parts)