I want to export to a new txt file a list of URLs from another txt file. The first txt file looks like this :
http://pastebin.com/raw/10hvUbTi Emails: 631 Keywords: 0.0
http://pastebin.com/raw/5f0bnCq9 Emails: 61 Keywords: 0.0
I am trying to create a list that will look like this:
URL
URL
I am not get anything as an output in pycharm
Can someone help please?
import re
import urllib2
filename = 'C:\\file.txt'
pattern = ('^\S*')
with open(filename) as f:
for line in f:
if pattern in line:
print line