#!/usr/bin/perl -w #fn - First Name #ct - Extension #use strict ; #use warnings ; #Name if the File that contains the User Direcotry Data open (FILE, 'phonelist.csv') || die("Could not open the input file directory.csv!\n"); #create if not yet created and/or overwrite existing directory-000000000000.xml open (OUTPUTFILE, ">000000000000-directory.xml") || die("Could not open/create the output file directory-000000000000.xml!\n"); #below section contains the standard [general] header of the sip.conf print OUTPUTFILE "\n"; print OUTPUTFILE "\n"; print OUTPUTFILE "\t\n"; while () { chomp; ################################################################### #we are splitting the comma seperated values into the single Items# #add additional $columnX to accomodate further entries# ################################################################### ($column1,$column2,) = split(','); print OUTPUTFILE "\t\t\n"; print OUTPUTFILE "\t\t\t$column1\n"; print OUTPUTFILE "\t\t\t$column2\n"; print OUTPUTFILE "\t\t\n"; } print OUTPUTFILE "\t\n"; print OUTPUTFILE "\n"; #close the csv example file close (FILE); #close the modified sip.conf file close (OUTPUTFILE); exit;