Gossamer Forum
Home : General : Perl Programming :

omg i hate excel can some 1 give me a light

Quote Reply
omg i hate excel can some 1 give me a light
I have to make a excel file from a data base that have around 4000 users.
oh yes sure so i made something like:

open(XLS,">>file.xls");
while (bla bla bla) {
print XLS "$user_name\t\n";
}
close(XLS);

the \t is the tabulation to get it formated into the excel.

My problem is reading just this field($user_name) from the data base the file goes over 70 mb there any possibility of make it around 3 mb or less or something near 10 mb at max ?
Quote Reply
Re: [NamedRisk] omg i hate excel can some 1 give me a light In reply to
If you're just printing a username to a file 70 MB sounds *very* excessive. What does the file look like when you are done? It sounds like you're getting dupes or something. Can you post your code? Also, have you looked into the Spreadsheet::WriteExcel modules[1] on CPAN?

~Charlie

[1]http://search.cpan.org/~tmtm/Spreadsheet-WriteExcel-Simple-1.02/Simple.pm[/irl]
Quote Reply
Re: [Chaz] omg i hate excel can some 1 give me a light In reply to
i think i got it solved it was my bad ...
i was working on a system for hours and i wasnt thinking very well anymore.

later i got it solved and it runs for 200 kb now.

a working example on how it looks

open (XLS,"test.xls");
print XLS "Users\t\n";
print XLS "\n";
for (1..4000) {
print XLS "user name\t\n";
}
close(XLS);

and works fine this way.

a full data base now get 1.6 mb

thx for the advice im reading to http://search.cpan.org/...imple-1.02/Simple.pm
and might change it for this way much easer and can be formated.