in reply to Color highlighting in Excel
It used Spreadsheet::WriteExcelXML because this type of in-string highlighting isn't (currently) possible with Spreadsheet::WriteExcel. This means, however, that the end user must have Excel 2002/2003.
#!/usr/bin/perl -w use strict; use Spreadsheet::WriteExcelXML; my $workbook = Spreadsheet::WriteExcelXML->new("file.xls"); my $worksheet = $workbook->add_worksheet(); my $ident = 'days'; my $row = 0; while (<DATA>) { if (s[\b($ident)\b][<B>$1</B>]og) { chomp; $worksheet->write_html_string($row++, 0, $_); } } __DATA__ These are the days and these are the days. What are days for? This is the time. And this is the record of the time. I thank you for the days.
--
John.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Color highlighting in Excel
by imperl (Novice) on Sep 19, 2005 at 08:27 UTC | |
by jmcnamara (Monsignor) on Sep 19, 2005 at 09:06 UTC | |
by imperl (Novice) on Sep 19, 2005 at 09:21 UTC | |
by jmcnamara (Monsignor) on Sep 19, 2005 at 09:33 UTC |