in reply to Carriage returns in Excel files
The following program works for me:
Output is: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; } }
Note: "Cell 3 Cell 4 Cell 5" is one block!Cell 1, Cell 2, Cell 3 Cell 4 Cell 5, Cell 6, Cell 7
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
|
|---|