Re: Spreadsheet::ParseExcel problem

2012-06-06 Thread Jim Gibson
On Jun 6, 2012, at 11:33 AM, rbm wrote: > Hi, > > I'm using perl module Spreadsheet::ParseExcel here > http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel-0.59/lib/Spreadsheet/ParseExcel.pm. > > I have a Excel spreadsheet which has 8 worksheets in and I would like > to parse just worksheet

Spreadsheet::ParseExcel problem

2012-06-06 Thread rbm
Hi, I'm using perl module Spreadsheet::ParseExcel here http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel-0.59/lib/Spreadsheet/ParseExcel.pm. I have a Excel spreadsheet which has 8 worksheets in and I would like to parse just worksheets 3 and 4. I've tried amending this line in my script e

Re: win32::OLE helpppp

2012-06-06 Thread Jim Gibson
On Jun 6, 2012, at 1:54 PM, Ken Furff wrote: > apparently win32::OLE can be used to write to an existing spreadsheet. I have > read the cpan docs and tried a hundred things, but I cant seem to get the > syntax right. Win32::OLE doesn't write spreadsheets, but it does try to control the Excel

Re: there has to be a way

2012-06-06 Thread Jim Gibson
On Jun 6, 2012, at 1:20 PM, Ken Furff wrote: > ok so I figured out that Spreadsheet::writeExcel only writes new spreadsheets > and that its difficult to overwrite cells or append them in an existing > spreadsheet. > > Is there a module out there that I can use to do what I'm trying to do? Yo

win32::OLE helpppp

2012-06-06 Thread Ken Furff
apparently win32::OLE can be used to write to an existing spreadsheet. I have read the cpan docs and tried a hundred things, but I cant seem to get the syntax right. I'm going to post this script one more time. #!/usr/bin/perl use strict; use Spreadsheet::XLSX; use File::Copy; use Win32::OLE;

RE: there has to be a way

2012-06-06 Thread Jack Maney
I'll expand upon the same advice that I gave to you privately in an email: slow down. Use Data::Dumper to look at the data that you're capturing. Look at documentation to get the contents of a cell. If you're going to use code that you got from somewhere else, don't use it unless you can desc

there has to be a way

2012-06-06 Thread Ken Furff
ok so I figured out that Spreadsheet::writeExcel only writes new spreadsheets and that its difficult to overwrite cells or append them in an existing spreadsheet. Is there a module out there that I can use to do what I'm trying to do? I have written a script which uses Spreadsheet::xlsx to pull

Re: writing to a Spreadsheet using Spreadsheet::WriteExcel

2012-06-06 Thread Jim Gibson
On Jun 6, 2012, at 8:52 AM, Ken Furff wrote: > I have written a script for updating and modifying a price list in Excel. > First let me show you the script: > > #!/usr/bin/perl > use strict; > use Spreadsheet::XLSX; > use SpreadSheet::WriteExcel; > > my $excel = Spreadsheet::XLSX -> new ('buil

bug in net::openssh? or what am i doing wrong?

2012-06-06 Thread Rajeev Prasad
http://cpan.uwinnipeg.ca/htdocs/Net-OpenSSH/Net/OpenSSH.html#scp_put     following is failing with an error when $folder is not defined. is that correct? i think it should assume $folder as null variable and continue to save in home folder on destination???   $scpresult = $ssh->scp_put($file,$fol

writing to a Spreadsheet using Spreadsheet::WriteExcel

2012-06-06 Thread Ken Furff
I have written a script for updating and modifying a price list in Excel. First let me show you the script: #!/usr/bin/perl use strict; use Spreadsheet::XLSX; use SpreadSheet::WriteExcel; my $excel = Spreadsheet::XLSX -> new ('build.xlsx'); my $sheet = $excel->Worksheet('Sheet1'); my ($row_min,$

Re: Trimming Whitespace

2012-06-06 Thread Shawn H Corey
On 12-06-06 11:46 AM, Matt wrote: Thanks. So what happens when you try to 'push' an empty string to an array? I assume nothing goes in the array? No, an empty string is added to the end of the array. However, if you push an empty list, (), onto an array, nothing is added. -- Just my 0.000

Re: Trimming Whitespace

2012-06-06 Thread Matt
> Shawn has already provided an answer, but I wanted to point out what > your regular expression (/^\s*$/) is doing. That expression is > matching any string that is empty or only contains whitespace. > HTH, Ken Thanks. So what happens when you try to 'push' an empty string to an array? I assume

Re: refine the code

2012-06-06 Thread lina
On Wed, Jun 6, 2012 at 1:45 AM, Shlomi Fish wrote: > Hi Lina, > > On Tue, 5 Jun 2012 16:03:52 +0800 > lina wrote: > >> Hi, >> >> I wrote one, but don't know make it mature. >> > > Overall, your program is OK, but see below for my nitpicks. > >> Here is what I am going to do. >> >> "43 43   40 1",

Re: Trimming Whitespace

2012-06-06 Thread Ken Slater
On Wed, Jun 6, 2012 at 10:27 AM, Matt wrote: > Looking at some old code I wrote. > > my @listing; > open(IN, list.txt) or die $!; > while () { >    chomp; >    next if /^\s*$/; >    next if /^#/; >    push(@listing, $_); > } > close IN; > > I want to trim any new lines off end of data.  chomp does

Re: Trimming Whitespace

2012-06-06 Thread Shawn H Corey
On 12-06-06 10:27 AM, Matt wrote: Looking at some old code I wrote. my @listing; open(IN, list.txt) or die $!; while () { chomp; next if /^\s*$/; # skip lines beginning with whitespace next if /^\s/; next if /^#/; push(@listing, $_); } close IN; I want to trim an

Trimming Whitespace

2012-06-06 Thread Matt
Looking at some old code I wrote. my @listing; open(IN, list.txt) or die $!; while () { chomp; next if /^\s*$/; next if /^#/; push(@listing, $_); } close IN; I want to trim any new lines off end of data. chomp does that. I want to skip any lines that begin with # and next if /^#

Re: Comparing two arrays

2012-06-06 Thread Brock
On 2012.06.06.04.06, Uri Guttman wrote: > On 06/06/2012 03:58 AM, Wernher Eksteen wrote: > >I have two arrays that I need to compare, and then print the differences: > > this is answered in the perl FAQ. please check that before you ask > ... Specifically, you can use "perldoc -q" to search throu

Re: Comparing two arrays

2012-06-06 Thread Uri Guttman
On 06/06/2012 03:58 AM, Wernher Eksteen wrote: Hi, I have two arrays that I need to compare, and then print the differences: this is answered in the perl FAQ. please check that before you ask what could be a frequently asked question. in fact, i teach perl newbies to read/skim the entire FAQ

Re: Comparing two arrays

2012-06-06 Thread pangj
Try Array::Diff http://search.cpan.org/~typester/Array-Diff-0.07/lib/Array/Diff.pm Hi, I have two arrays that I need to compare, and then print the differences: @array1 contains this: /dev/sdmt1 /c4devpr64 /dev/sdmq1 /c4devpr66 /dev/sdmp1 /c4devpr67 /dev/sdml1 /c4devpr69 @array2 contains t

Comparing two arrays

2012-06-06 Thread Wernher Eksteen
Hi, I have two arrays that I need to compare, and then print the differences: @array1 contains this: /dev/sdmt1 /c4devpr64 /dev/sdmq1 /c4devpr66 /dev/sdmp1 /c4devpr67 /dev/sdml1 /c4devpr69 @array2 contains this: /dev/sdmt1 /c4devpr64 /dev/sdms1 /c4devpr65 /dev/sdmn1 /c4devpr68 /dev/sdml1 /c4de