CSV File

Hi I wrote a perl script to output a text file filled with ip addresses and ports that i scanned into microsoft excel. Now that the data is in excel my boss wants me to organize the file in csv format such as

Server,port,protocol,random,random,random
ns1,25,tcp,stuff,stuff,stuff

Can any one help me with this Please?
my code

#!/usr/bin/perl

$input = `Cat /cygdrive/c/Windows/System32/test11.txt | grep -v 'SYN Stealth'`;
chomp input;
$output =" /cygdrive/c/Users/bpaul/Desktop/194.csv ";
if (! -e "$output")
{
`touch $output`;
}
open (OUTPUTFILE, ">$output") || die "Can't Open file $output";
print OUTPUTFILE "$input\n";
close (OUTPUTFILE);
Here is a piece of my file 
      Nmap scan report for 69.25.194.2       Host is up   (0.072s  latency).       Not shown:   9992 filtered ports       PORT     STATE     SERVICE       25/tcp   open     smtp   
      80/tcp   open     http   
      82/tcp   open     xfer   
      443/tcp  open 
    https       4443/tcp   closed 
pharos        5666/tcp   closed 
nrpe       8080/tcp   closed 
http-proxy       9443/tcp    closed tungsten-https

So far my code took my txt file and outputted it to excel now I need to format the data like this:

Code:

  Server,port,protocol,random,random,random
ns1,25,tcp,stuff,stuff,stuff

What's your input look like? What's your code look like?

Why not just change your Perl script to write a CSV file instead, or as well as?

And, as per forum rules, please use a descriptive subject title in future. "CSV file" says nothing about your problem.

my code

#!/usr/bin/perl

$input = `Cat /cygdrive/c/Windows/System32/test11.txt | grep -v 'SYN Stealth'`;
chomp input;
$output =" /cygdrive/c/Users/bpaul/Desktop/194.csv ";
if (! -e "$output")
{
`touch $output`;
}
open (OUTPUTFILE, ">$output") || die "Can't Open file $output";
print OUTPUTFILE "$input\n";
close (OUTPUTFILE);
Here is a piece of my file 
      Nmap scan report for 69.25.194.2       Host is up   (0.072s  latency).       Not shown:   9992 filtered ports       PORT     STATE     SERVICE       25/tcp   open     smtp   
      80/tcp   open     http   
      82/tcp   open     xfer   
      443/tcp  open 
    https       4443/tcp   closed 
pharos        5666/tcp   closed 
nrpe       8080/tcp   closed 
http-proxy       9443/tcp    closed tungsten-https

So far my code took my txt file and outputted it to excel now I need to format the data like this:

Server,port,protocol,random,random,random
ns1,25,tcp,stuff,stuff,stuff