Solved

Spreadsheet Application

Posted on 2006-11-20
11
315 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 84

Expert Comment

by:ozo
ID: 17982621
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 500 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
 

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 500 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
execute pl/sql block from perl program 3 118
Perl program to obtain a machine's memory usage 6 22
SIMPLE Perl Regex 1 153
Perl tar error 8 49
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now