Solved

Spreadsheet Application

Posted on 2006-11-20
11
314 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 …
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 video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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