with open('t.txt', 'r') as f:
text = f.read()
cif = ''
other = ''
for char in text:
if char.isdigit():
cif += char
else:
other += char
with open('cif.txt', 'w') as f:
f.write(cif)
with open('other.txt', 'w') as f:
f.write(other)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
with open('t.txt', 'r') as f:
text = f.read()
cif = ''
other = ''
for char in text:
if char.isdigit():
cif += char
else:
other += char
with open('cif.txt', 'w') as f:
f.write(cif)
with open('other.txt', 'w') as f:
f.write(other)