Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. with open('oids.txt', 'r') as file:
  2.     oids = file.readlines()
  3. print(oids) # just to prove that it was converted to list of officeIds
  4. # if you want to get rid of '\n' you should consider using oid.strip() function
  5. with open('oids.xml', 'w') as file:
  6.     file.write(f'<xml>')
  7.     for oid in oids:
  8.         file.write(f'<officeid>{oid}</officeid>\n')
  9.     file.write(f'</xml>')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement