From: Jack on
Hello all

I have a question!!
there is a file with extension dat (ie *.dat) in my
unix environment and i wanted to change this to .xls format i mean i
have to transfer this file to an excel sheet and then i need to send
this file as an attachment to an email address and all this should be
done in perl....please reply me soon

regards,
jack

From: jmcnamara on
Jack wrote:
> there is a file with extension dat (ie *.dat) in my
> unix environment and i wanted to change this to .xls format i mean i
> have to transfer this file to an excel sheet and then i need to send
> this file as an attachment to an email address and all this should be
> done in perl

As pointed out above you can create a Excel file with Perl using
Spreadsheet::WriteExcel:

http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/

You didn't say what format the .dat file was but in the distro there
are serveral example programs that will hel get you started. For
example to convert from csv or tab-separated files to Excel:


http://search.cpan.org/src/JMCNAMARA/Spreadsheet-WriteExcel-2.17/examples/csv2xls.pl

http://search.cpan.org/src/JMCNAMARA/Spreadsheet-WriteExcel-2.17/examples/tab2xls.pl

Or how to create and email an Excel file (using Mail::Sender in this
case but there are many other modules):


http://search.cpan.org/src/JMCNAMARA/Spreadsheet-WriteExcel-2.17/examples/sendmail.pl

John.
--

From: Martijn Lievaart on
On Fri, 27 Oct 2006 12:37:47 -0700, Jack wrote:

> Hello all
>
> I have a question!!
> there is a file with extension dat (ie *.dat) in my
> unix environment and i wanted to change this to .xls format i mean i

I recently accomplished this by writng the file as html, but giving it a
xls extention. Dirty, but it works.

> have to transfer this file to an excel sheet and then i need to send
> this file as an attachment to an email address and all this should be
> done in perl....please reply me soon

Quickest way is to uuencode it and pipe that to a mailer (f.i. mail). No
perl needed.

M4
--
Redundancy is a great way to introduce more single points of failure.