in reply to Simple Text Conversion
This will transl(iter)?ate the space character into the pipe character, and the comma character into the space character.my $data =~ tr/ /|/; $data =~ tr/,//d; # get rid of the comma, if you want
If there's a possibility that any of the fields will contain spaces or pipes or commas, look at the Text::CSV module from CPAN. Writing a regex to take care of this will not only test your skills at planning for all contingencies, it will cause you to go bald.
|
|---|