Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! python3
- # dzieli ciągi skopiowane z zakresu komórek excela i wkopiowane
- # do schowka na nazwę adres i kopiuje z powrotem do showka
- import pyperclip, re
- lines = list(filter(None, pyperclip.paste().split('\r\n')))
- # utworzenie wzorca
- splitPattern = re.compile(r'(s.c.|s. c.|s.a.| sa|o.o.|z oo|z o. o.|z o.o|kft|s.r.o.|sp.k.| sc|s.j.| sj) ', re.I)
- # dodaje tabulacje po formie prawnej
- for i in range(len(lines)):
- lines[i] = splitPattern.sub(r'\1\t', lines[i])
- # utworzenie ciągu i wklejenie do schowka
- pyperclip.copy('\n'.join(lines))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement