Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- httpsgoogledotcom, GooglePlace2, Direcciones, Montain View, Email, googplace@yourplace.com
- > httpsgoogledotcom, GooglePlace, Website, "<a> href='httpgoogledotcom'></a>",,,,,,,,,,,,,,
- > "<a href='httpgoogledotcom'></a>",,,,,,,,,,,,,
- > ,,Direcciones, Montain View, Email, googplace@yourplace.com
- > httpsbingdotcom, BingPlace, Direcciones, MicroWorld, Email, bing@yourplace.com
- > httpsgoogledotcom, GooglePlace, Website, "<a> href='httpgoogledotcom'></a>",,,,,,,,,,,,,,
- > "<a href='httpgoogledotcom'></a>",,,,,,,,,,,,,
- > httpsbingdotcom, BingPlace, Direcciones, MicroWorld, Email, bing@yourplace.com
- > httpsgoogledotcom, GooglePlace, Website, "<a href='httpgoogledotcom'></a>",Direcciones, Montain View, Email, googplace@yourplace.com
- > httpsbingdotcom, BingPlace, Direcciones,MicroWorld, Email, bing@yourplace.com
- > httpsgoogledotcom, GooglePlace,Website, <a href='httpgoogledotcom'></a>"
- import re
- with open('Reutput.csv') as reuf, open('Put.csv', 'w') as putuf:
- text = str(reuf.read())
- for lines in text:
- regex = re.compile('</a>".*?Direc',re.DOTALL)
- groups = re.search('</a>".*?Direc',lines,re.DOTALL)
- if not 'https' in groups:
- replace = re.sub(regex,'</a>",Direc',text)
- if 'https' in groups:
- replace = re.sub(regex,'</a>"nhttp',text)
- replace = str(replace)
- putuf.write(replace)
- reuf.close()
- putuf.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement