Skip to content

Instantly share code, notes, and snippets.

View Turbid's full-sized avatar

Ilya Demyanov Turbid

View GitHub Profile
import csv
import glob
import re
for filename in glob.glob('*.csv'):
with open(filename, 'r', encoding='utf-8') as csvfile:
# pids = csv.reader(csvfile, delimiter=',', quotechar='|')
pids = csv.DictReader(csvfile)
with open('_' + filename, 'w', encoding='utf-8') as csvfile_new:
writer = csv.DictWriter(csvfile_new, fieldnames=pids.fieldnames)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--MSG-1 configuration version 1.7-->
<Root>
<IP_config>
<SIP_mask>28</SIP_mask>
<SIP_IP>10.107.189.4</SIP_IP>
<SIP_gateway>10.107.189.3</SIP_gateway>
<Mng_mask>28</Mng_mask>
<Mng_IP>10.107.188.74</Mng_IP>
<RTP_mask>28</RTP_mask>