try this:
#!/usr/bin/perl -w
use strict;

my $if = "path_to_input_file";
my $of = ">path_to_output_file";
my ($name, $addr);

open(IF, $if) or die "Can't open file $if for reading\n";
open(OF, $of) or die "Can't open file $of for writing\n";
while (<IF>) {
  chomp;
  (undef,$name,undef,undef,undef,undef, $addr) = split(/\| */);
  print OF "$name, $addr\n";
}

A+

Leon Dippenaar a écrit :
> 
> Can anybody just give me a quick example of how one would go about doing
> this? I am on the verge on insanity and I might already be over that
> edge.
> 
> The input file contains names and email addresses.
> 
> The output file with all the names & addresses must be comma delimited
> and listed one address per line
> 
> input looks like this :
> 0001616 | the hospital | box 11667 | selcourt | mulbarton | 1733 |
> [EMAIL PROTECTED]
> 
> output must look like this
> 
> the hospital , [EMAIL PROTECTED]
> 
> Please someone merciful :-)
> 
> Any examples , or a push in the right direction would be greatly
> appreciated..
> --
> Leon
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to