in reply to Carriage returns in Excel files

How would you like the output to be formatted? Are you reading the excel file directly (e.g. with Spreadsheet::ParseExcel::Simple) or are you first exporting it as a tab-separated file?

The following program works for me:

use strict; use Spreadsheet::ParseExcel::Simple; my $xls = Spreadsheet::ParseExcel::Simple->read('test.xls'); foreach my $sheet ( $xls->sheets ) { while ( $sheet->has_data ) { my @data = $sheet->next_row; foreach (@data) { s/\n/ /gs; } print join ', ', @data; } }
Output is:
Cell 1, Cell 2, Cell 3 Cell 4 Cell 5, Cell 6, Cell 7
Note: "Cell 3 Cell 4  Cell 5" is one block!

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James