Solved

Spreadsheet Application

Posted on 2006-11-20
11
317 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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
 

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

772 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