in reply to parsing files and modifying format
Perhaps I'm missing something, but the original request didn't say anything about doing recursive processing. Assuming that it's required, based on the OP's use of 'File::Find' in his script (which he's not actually using) may not be appropriate.
Perl-only solution from the command line (processes all files in the current directory, ignores lines that don't have commas, converts the file content to a single line of CSV):
perl -i -0wpe's/\A[^\n]+\n//;s/\n(?!\Z)/,/g' *
-- Human history becomes more and more a race between education and catastrophe. -- HG Wells
|
|---|