in reply to Converting a text file to a csv file

It's not clear to me how you want to process the source file. Do you want one character per cell? I guess you do.
open TXT, "<", $file) or die "Cannot open $file: $!"; while(<TXT>) { chomp; my @array = split ''; # 1 char per array item s/\s// foreach @array; # replace space with empty string ... }
The "..." must be replaced with whatever you have to do to output the row to the CSV file, for example from the code supplied by suhailck in Re: Converting a text file to a csv file.

Replies are listed 'Best First'.
Re^2: Converting a text file to a csv file
by $new_guy (Acolyte) on Sep 28, 2010 at 10:24 UTC
    Hi Bart,

    I doesn't seem to work for me! It still gives the same output!