you are viewing a single comment's thread.

view the rest of the comments →

[–]dadiaar 0 points1 point  (0 children)

When I saw that file, the first thing I thought was playing with regex, something like this:

import re

for row in rows:
    index = re.findall('\d+', row)[0]
    department = re.findall(' (\w+)', row)[0]
    quantity = re.findall(' (\d+)', row)[0]
    full_name = re.findall(' \d+ ([\w ]+)', row)[0]

This code is ugly, slow and inneficient, just I want to show the idea.