[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

01/14/2002 at 10:58AM PST, ID: 20255080
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

Write to excel file

Asked by draco51 in Perl Programming Language

Tags: perl

I got this code this far:

===flat.txt
ID|name|value|year|something
1|mmm|111|1980|qweeerr
2|aaa|211|1981|hhhhjjr
3|bbb|311|1982|jkkhhkh
4|ccc|411|1983|mnmhhjj
5|dsd|511|1984|jjkjkkj

==flat.pl
#!/usr/local/bin/perl

$|++; ##  Disable output buffering.

##  Print Excel Mime header.
print "Content-type: application/vnd.ms-excel\n\n";

##  Full path to the delimited flat file.
$flat_file='/full/path/to/flat.txt';

##  Open the file & read each line of the file as an
##  element of an array.
open(F,$flat_file) || die $!;
@lines=<F>;
close(F);

##  Remove the newline characters from end of each element.
chomp(@lines);
shift(@lines);  ##  Remove the header from the array.

##  Process each element of the array
foreach (@lines){
 ##  break each element using | as the delimiter.
 @cols=split(/\|/,$_);
 ##  Join each col using \t delimiter.
 $header=join("\t",@cols)."\n";
 print $header;
}

This code does work but it isn't possible to give the excel xls file a name! The xls file is now called like the script name with the extension xls. For example: when the script is called: test.pl the excel file will be called test.xls.

I have two questions:
1) How to change this script so I have the option to set the xls files name or give the xls file the same name as the flat databases file name with the extension xls!
In the example it would be flat.xls

2) How to change the script so the xls file will be written and stored to my own server? So I can download the files from my server whereever and when I want!!
[+][-]01/14/02 11:35 AM, ID: 6732430

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: perl
Sign Up Now!
Solution Provided By: datibbaW
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01/14/02 12:17 PM, ID: 6732502

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/14/02 12:54 PM, ID: 6732558

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/14/02 01:09 PM, ID: 6732588

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/14/02 09:59 PM, ID: 6733260

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/15/02 08:44 AM, ID: 6734599

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/15/02 10:02 PM, ID: 6735595

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/16/02 09:04 AM, ID: 6736847

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/16/02 09:42 AM, ID: 6736965

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/16/02 09:47 AM, ID: 6736977

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/16/02 10:14 AM, ID: 6737065

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/16/02 10:19 AM, ID: 6737079

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/16/02 10:31 AM, ID: 6737117

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/16/02 10:43 AM, ID: 6737136

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/16/02 10:58 AM, ID: 6737169

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74