#!/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 () { if (s[\b($ident)\b][$1]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.