Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Spreadsheet Application

Posted on 2006-11-20
11
Medium Priority
?
331 Views
Last Modified: 2010-08-05
Hi

I am trying to develop a web application using Perl and CGI.
Step 1: The webapplication were data will be uploaded from spreadsheet to database using multiform upload.
Step 2: Read the spread sheet data and upload it to database.

if any one come across similar application please help me with sample code. This is first time I am working with spreadsheets.

Note: It is not a comma saperated file.It is a spreadsheet(excel file with formated columns

It would be great if artical explains me step by step process we need to follow to upload spreadsheet data to database.

Thanks

 
0
Comment
Question by:basirana
11 Comments
 
LVL 85

Expert Comment

by:ozo
ID: 17982621
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 1500 total points
ID: 17982665
ozo.

Spreadsheet::Perl won't read excel spreadsheets.

For reading an Excel spreadsheet you need Spreadsheet::ParseExcel

http://search.cpan.org/~kwitknr/Spreadsheet-ParseExcel-0.2603/ParseExcel.pm

0
 

Author Comment

by:basirana
ID: 17982813
I am sorry but its a CPAN and it explains spread sheet module. Before that I need to upload the file.
How can I upload file from browser to the server were the perl program read the excel data.

Questions:
1.How to upload file?
2.How to read excel file and save the data to database?

Please help with running example.

Thanks
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:basirana
ID: 17982839
Is it possible we can upload file to database(BLOB)?
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 1500 total points
ID: 17982891
To upload the file, use the CGI module upload function.

http://search.cpan.org/~lds/CGI.pm-3.25/CGI.pm#CREATING_A_FILE_UPLOAD_FIELD

Note that CGI is a standard Perl module, so you shouldn't need to install it.

To save the data to the database, use the DBI module and an associated DBD (Database Driver) module.

http://dbi.perl.org/
0
 

Author Comment

by:basirana
ID: 17983104
Bro I dont have ParseExcel.pl installed on the server so I cannot use Spreadsheet module.
Is there a way we can save the file to Database (BLOB).

Multipart file upload to ---> Database BLOB

Thanks
0
 

Author Comment

by:basirana
ID: 17983152
Bro I am bit confused this is my first application were I am using fileupload and spreadsheet. If anyone can explain me how the process goes were to start.
I think alread this kind of a application would have been used.

The problem is its a web application.

Please help me with good example gives me step by step process.

Thanks
0
 
LVL 48

Accepted Solution

by:
Tintin earned 1500 total points
ID: 17983185
The flow is:

1.  HTML form where user selects the Excel file to upload.
2.  Perl CGI script that uses the CGI upload functions to receive the Excel spreadsheet.
3.  The script then reads the spreadsheet with SpreadSheet::ParseExcel
4.  The script processes the data and loads it into the database via the DBI interface.

If you don't install the required modules, you are going to have a *very* difficult time in writing your own code to process it.
0
 

Author Comment

by:basirana
ID: 17984074
I will try tp install spreadsheet module bro.

Thanks
0
 

Author Comment

by:basirana
ID: 17984595
If you have sample code for file upload that would really helpfull.

Thanks
0
 
LVL 39

Expert Comment

by:Adam314
ID: 17988111
The sample code is on the documentation for the CGI module, at the link Tintin provided.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question