Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

To use this module
use Spreadsheet::WriteExcel;

As stated above this module allows you to write excel files
without that annoying popup asking you how your file is
delimeted when you open the file. It works very well,
the only problem i had was trying to convert one of our flat files
that is over 70,000 records in length. But after
i checked the problem is documented, it can only produce files
<~ 7.0 MB. heres on little program I have created with it

#!/usr/bin/perl use Spreadsheet::WriteExcel; print "Enter the path to the file(ie /home/): "; $path = <>; chomp($path); print "Enter the filename(ie data): "; $fname = <>; chomp($fname); $file = "$path$fname"; my $workbook = Spreadsheet::WriteExcel->new("/tmp/$fname.xls"); $worksheet1 = $workbook->addworksheet(sheet1); $worksheet2 = $workbook->addworksheet(sheet2); $worksheet3 = $workbook->addworksheet(sheet3); $format = $workbook->addformat(); $format->set_bold(); $format->set_color('black'); $format->set_align('center'); $format->set_size('10'); open input, "$file" || die "Can't open that file"; $k=0; for (<input>){ chomp($_); @data = split(/\t/,$_); for ($i=0; $i<=@data; $i++){ $worksheet1->write($k, $i, $data[$i], $format); } $k++; }
Good Luck
Rob

In reply to Spreadsheet::WriteExcel by BigGuy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (5)
    As of 2019-05-20 08:24 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Do you enjoy 3D movies?



      Results (125 votes). Check out past polls.

      Notices?