#!/usr/bin/perl -w
$readfile = "simplecin.txt";
$outfile = "simplecout.txt";
open ($filein, '<', "$readfile" )
    or die "cannot open $readfile: $!";
# open for output
   if (!open ($fileout, '>', "$outfile"))
     { die "cannot open $outfile for output: $!";}

while  ($buf = <$filein> ){
# remove /n
chomp($buf) ;
$x = $y = $z =  "Empty";

($x, $y, $z) = split( /,/, $buf) ;
# (splits at , char )
printf "%s;%s;%s\n", $x, $y, $z;
$outstring = $x . ";" . $y . ";" . $z. "\n";
print $fileout $outstring

}

    

