i have a Big file 50G i use this script to remove all point except the points after @ example file.tsv
a.a.aabcd@mail.com
bbbb.ccc.c@mail.com
abdc@mail.com
my script :
import codecs
contents = codecs.open('file.tsv', encoding='utf-8').read()
sys.stdout=open("newFile.tsv","w")
print contents.replace('.','')
sys.stdout.close();
Output :
aaaabcd@mailcom
bbbbcccc@mailcom
abdc@mailcom
i want to return :
aaaabcd@mail.com
bbbbcccc@mail.com
abdc@mail.com
remove all point except mail.com
i use linux commande to change it :
os.system('time sed -i \'s/@mailcom/@mail.com/g\' newFile.tsv');