473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Convert Excel to CSV

Hi,

How to convert a excel file to .csv format?

Please provide me the Perl Module and the script to do this funcionality.


Thank you!
Jan 8 '07 #1
6 16160
miller
1,089 Expert 1GB
You simply need two CPAN modules to accomplish this:

http://search.cpan.org/search?query=...et::ParseExcel
http://search.cpan.org/search?query=Text::CSV
Jan 9 '07 #2
Hi,

I have installed Spreadsheet::ParseExcel in my Unix Machine. When i am trying to call this Module using the below mentioned script, It is giving me a error saying that" Module cannot be found"

Expand|Select|Wrap|Line Numbers
  1. use strict;
  2. use Spreadsheet::ParseExcel;
  3.  
  4. my $excel = Spreadsheet::ParseExcel::Workbook->Parse(Excel File1.xls);
  5. foreach my $sheet (@{$excel->{Worksheet}}) {
  6.     printf("Sheet: %s\n", $sheet->{Name});
  7.     $sheet->{MaxRow} ||= $sheet->{MinRow};
  8.     foreach my $row ($sheet->{MinRow} .. $sheet->{MaxRow}) {
  9.         $sheet->{MaxCol} ||= $sheet->{MinCol};
  10.         foreach my $col ($sheet->{MinCol} ..  $sheet->{MaxCol}) {
  11.             my $cell = $sheet->{Cells}[$row][$col];
  12.             if ($cell) {
  13.                 printf("( %s , %s ) => %s\n", $row, $col, $cell->{Val});
  14.             }
  15.         }
  16.     }
  17. }
Could you please assist me on this and give me the correct code?

Thanks,

Aravind
Jan 15 '07 #3
Perler
1
Are you sure that you included something like

#!/usr/bin/perl

at the top of your code? Just askin'...


Hi,

I have installed Spreadsheet::ParseExcel in my Unix Machine. When i am trying to call this Module using the below mentioned script, It is giving me a error saying that" Module cannot be found"

use strict;
use Spreadsheet::ParseExcel;

my $excel = Spreadsheet::ParseExcel::Workbook->Parse(Excel File1.xls);
foreach my $sheet (@{$excel->{Worksheet}}) {
printf("Sheet: %s\n", $sheet->{Name});
$sheet->{MaxRow} ||= $sheet->{MinRow};
foreach my $row ($sheet->{MinRow} .. $sheet->{MaxRow}) {
$sheet->{MaxCol} ||= $sheet->{MinCol};
foreach my $col ($sheet->{MinCol} .. $sheet->{MaxCol}) {
my $cell = $sheet->{Cells}[$row][$col];
if ($cell) {
printf("( %s , %s ) => %s\n", $row, $col, $cell->{Val});
}
}
}
}

Could you please assist me on this and give me the correct code?

Thanks,

Aravind
Jul 24 '08 #4
numberwhun
3,509 Expert Mod 2GB
Are you sure that you included something like

#!/usr/bin/perl

at the top of your code? Just askin'...
Perler,

I think it would be a good idea for you to stick with the newest posts. This post is over 1 1/2 years old and I doubt that the user that posted it will even see it.

Also, to the point in your post, since they are working with excel spreadsheets, I assume that they were working on a Windows system. The shebang line (#!/usr/bin/perll) is typically ignored on a windows system, unless of course its CGI and then it would have the -T option after it and only then would it be read.

Regards,

Jeff
Jul 24 '08 #5
KevinADC
4,059 Expert 2GB
pssst......Jeff......

I have installed Spreadsheet::ParseExcel in my Unix Machine
Jul 24 '08 #6
numberwhun
3,509 Expert Mod 2GB
pssst......Jeff......
Ok, bad assumption on my part. Long day!
Jul 24 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: rama | last post by:
I need to convert excel file to txt file programatically which may contain 60000 records i want to convert it into txt file and upload it into unix server thanks in advance rama
1
by: Arvind P Rangan | last post by:
Hi, Trying to convert excel file data to base64 for encryption. Can anyone help me on this. Thanks Arvind
2
by: karups | last post by:
Hi when i convert Excel file to dataset using the following code, i find that, some col. such as Col1 ------ 404 403 NOT 222
10
subashini Thiyagarajan
by: subashini Thiyagarajan | last post by:
i want to convert excel into pdf file,i had lot ofoptions to convert all free trials i tried but nothing is supporting hyperlinks can any one help me with the useful URL thanks
0
by: payelit21 | last post by:
Hi Friends, can any body help me to convert excel cell from date to general and passinfg value to min value and max value of axis in chart through VB. Thanks Payel
3
by: binny | last post by:
i use jet engine ,and oledb database but with this i get four errors which r compile time errores,plz help me to solve these errors i wrote this programe bt it is not working . using System.Web;...
3
by: lyne_asp | last post by:
Please help me to convert excel date to asp date. Here is my code objConnEx.open "Provider=Microsoft.Jet.OLEDB.4.0;Data...
2
kamill
by: kamill | last post by:
I need to convert excel file into PDF file using PHP, how can i do it. I am able to generate a pdf file. Is there any solution to export excel data into mysql database? I am waiting for help.
1
by: presario | last post by:
Hello to all, I have a problem "to convert Excel files to MS Access table and load the data to the application " I would really appreciate the work If anybody can help me in this...
0
by: Raymond Chiu | last post by:
Dear all, In my vb.net program, I am using excel object to create excel file and stored in a folder. How can it be converted to be pdf file automatically using dotnet coding or others? Actually...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.