Archive::Zip and CSV files for parsing
Hi; I'm using Archive::Zip to unzip a bunch of CSV files that I want to extract information from. The problem is that when I extact a file, and I try and read it into an array for line by line handling, the system doesn't see the line breaks. Has anyone run into this? Here's the relevant snippet: @members = $archive_in-members(); foreach (@members) { my @contents = $archive_in-contents($_); foreach (@contents) { #line handling and parsing stuff goes here } } I would expect that the array @contents would be populated with one entry for each line in the CSV, but this is not the case. Typically the entire contents are one line, and a 0zero is the second line. Thanks, John Wunderlich Program Manager, Compliance Directeur de Programme, Conformité Tel/Fax: 514-908-3094 Ceridian www.ceridian.ca John Wunderlich.vcf Description: Binary data ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Archive::Zip and CSV files for parsing
Thanks for the replies. I replaced my @contents = $archive_in-contents($_); with my $content_line = $archive_in-contents($_); my @contents = split(/\n/, $content_line); and it works like a charm. John Wunderlich Program Manager, Compliance Directeur de Programme, Conformité Tel/Fax: 514-908-3094 Ceridian www.ceridian.ca $Bill Luebkert [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 03/09/2005 03:12 PM To [EMAIL PROTECTED] cc perl-win32-users@listserv.ActiveState.com Subject Re: Archive::Zip and CSV files for parsing [EMAIL PROTECTED] wrote: Hi; I'm using Archive::Zip to unzip a bunch of CSV files that I want to extract information from. The problem is that when I extact a file, and I try and read it into an array for line by line handling, the system doesn't see the line breaks. Has anyone run into this? Here's the relevant snippet: @members = $archive_in-members(); foreach (@members) { my @contents = $archive_in-contents($_); foreach (@contents) { #line handling and parsing stuff goes here } } I would expect that the array @contents would be populated with one entry for each line in the CSV, but this is not the case. Typically the entire contents are one line, and a 0zero is the second line. I haven't looked at the docs, but have you tried using split to handle it ? my $contents = $archive_in-contents($_); s/\000+$//; # just in case there is a null terminator my @contents = split /\r*\n/, $contents; -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // //DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /-- o // // Castle of Medieval Myth Magic http://www.todbe.com/ -/-' /___/__/_/_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs John Wunderlich.vcf Description: Binary data ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Tied objects for AD
Hi; I'm investigating some AD reporting tools, and it's looking like I may want to roll my own instead. Does the Tie::LDAP work with the objects in Active Directory? Or is there a better way to access their properties? What I'm looking to do is track group memberships and nested group memberships given a user id, and also to link NTFS permissions to network resources, based on the AD group that is put in the NTFS security group. Thanks, JW *** This communication is intended to be received only by the individual(s) or entity(s) to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error (by calling collect, if necessary) so that we can arrange for its return at our expense. Thank you in advance for your anticipated assistance and cooperation. Ce document est destinee aux seuls destinataires designes, personne ou groupe. Cette telecopie contient des renseignements confidentiels et est regie par les lois sur le droit d'auteur. Toute utilisation, copie, revue ou divulgation non autorisee de la presente est formellement interdite. Si vous avez recu cette telecopie et qu'elle ne vous etait pas destinee, veuillez communiquer immediatement avec l'expediteur, a frais vires si necessaire, afin que nous puissions prendre des dispositions a nos frais pour la recuperer. Nous vous remercions a l'avance de votre cooperation diligente. *** ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Deleting a worksheet in Excel
Hi; Don't most OO structures require constructor and destructor methods? Seems to me this is OK for OO. Requiring the Workbook to delete the Worksheet leads to a different problem...that of a WorkBook with no Worksheets. Since the raison d'etre for a WorkBook is as a container for WorkSheets, the coding to account for that could be even worse. Just my 2 cents worth. Later, John Wunderlich Program Manager, Compliance Directeur de Programme, Conformité Tel/Fax: 514-908-3094 Ceridian www.ceridian.ca Lyle Kopnicky [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 01/24/2005 05:29 PM To Perl-Win32-Users@listserv.ActiveState.com cc Subject Re: Deleting a worksheet in Excel Hsu, David wrote: Hi, Can someone let me know the syntax of deleting a worksheet in an Excel workbook. I am using Win32::OLE. I've tried: $Workbook-Worksheets{9}.Delete; Thanks, David This is an aside, not an attempt to answer your question, but: Doesn't anyone think it's a bit odd to tell a Worksheet to delete itself? It's like asking someone to shoot themselves and then bury themselves. The object has no context to do such a thing. Shouldn't we be telling the Workbook to delete the Worksheet? Something like $Workbook-DeleteWorksheet(9)? Bill Gates, are you listening? You are violating OO common sense! - Lyle ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs *** This communication is intended to be received only by the individual(s) or entity(s) to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error (by calling collect, if necessary) so that we can arrange for its return at our expense. Thank you in advance for your anticipated assistance and cooperation. Ce document est destinee aux seuls destinataires designes, personne ou groupe. Cette telecopie contient des renseignements confidentiels et est regie par les lois sur le droit d'auteur. Toute utilisation, copie, revue ou divulgation non autorisee de la presente est formellement interdite. Si vous avez recu cette telecopie et qu'elle ne vous etait pas destinee, veuillez communiquer immediatement avec l'expediteur, a frais vires si necessaire, afin que nous puissions prendre des dispositions a nos frais pour la recuperer. Nous vous remercions a l'avance de votre cooperation diligente. *** ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: UNIX utilities in Perl
If this is personal use on your machine, why don't you install cygwin? That will give a bash shell on your Windows box you can use for most of the shell work that you were accustomed to. (http://www.cygwin.com/) Just a thought. John Wunderlich Project Manager Ceridian [EMAIL PROTECTED] Tel: 514-908-3094 Fax: 514-908-3094 Mob: 514-827-7305 216 3 (superscript: ieme )Boulevard Terrasse-Vaudreuil, QC J7V 5R3 www.ceridian.ca Martin Leese [EMAIL PROTECTED] tic.com To Sent by: [EMAIL PROTECTED] perl-win32-users- te.com [EMAIL PROTECTED] cc ActiveState.com Subject UNIX utilities in Perl 11/10/2004 01:39 PM Hi, I am not sure if this is the right list for this question. I suspect it belongs on a list about CPAN, but the CPAN site doesn't appear to mention one. I am working on Windows, and find I keep writing very short Perl scripts to implement UNIX utilities. I call them zap_grep, zap_wc, zap_unique, zap_diff, zap_sort. My versions are very crude compared with the UNIX originals, and I wondered if somebody had already gone through this exercise. A search of CPAN came up with prep (Perl grep), wc, and uniq. Are these modules collected together anywhere? Should they be? What additional UNIX utilities would be useful? (Above, I suggest diff and sort.) What would be *really* useful is a method to pipe filters together. Regards, Martin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ForwardSourceID:NT00023006 * This communication is intended to be received only by the individual(s) or entity(s) to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error (by calling collect, if necessary) so that we can arrange for its return at our expense. Thank you in advance for your anticipated assistance and cooperation. * ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: UNIX utilities in Perl
Forgot to add that Windows Services for Unix is now a free download as well from Microsoft. I haven't used it so can't speak to its utility. Later, John Wunderlich Project Manager Ceridian [EMAIL PROTECTED] Tel: 514-908-3094 Fax: 514-908-3094 Mob: 514-827-7305 216 3 (superscript: ieme )Boulevard Terrasse-Vaudreuil, QC J7V 5R3 www.ceridian.ca Martin Leese [EMAIL PROTECTED] tic.com To Sent by: [EMAIL PROTECTED] perl-win32-users- te.com [EMAIL PROTECTED] cc ActiveState.com Subject UNIX utilities in Perl 11/10/2004 01:39 PM Hi, I am not sure if this is the right list for this question. I suspect it belongs on a list about CPAN, but the CPAN site doesn't appear to mention one. I am working on Windows, and find I keep writing very short Perl scripts to implement UNIX utilities. I call them zap_grep, zap_wc, zap_unique, zap_diff, zap_sort. My versions are very crude compared with the UNIX originals, and I wondered if somebody had already gone through this exercise. A search of CPAN came up with prep (Perl grep), wc, and uniq. Are these modules collected together anywhere? Should they be? What additional UNIX utilities would be useful? (Above, I suggest diff and sort.) What would be *really* useful is a method to pipe filters together. Regards, Martin ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ForwardSourceID:NT00023006 * This communication is intended to be received only by the individual(s) or entity(s) to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error (by calling collect, if necessary) so that we can arrange for its return at our expense. Thank you in advance for your anticipated assistance and cooperation. * ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Simple text editor under Windows
The perl plug-ins are at: http://e-p-i-c.sourceforge.net/ Like any IDE, it would be overkill for a single script or file. If you're building modules or a larger app with resource file it makes sense. It also appears to integrate well with CVS (I don't use that, but it should be noted.) JW Thomas, Mark - BLS CTR [EMAIL PROTECTED] 03/03/2004 01:12 PM To: '[EMAIL PROTECTED]' [EMAIL PROTECTED], Thomas, Mark - BLS CTR [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: RE: Simple text editor under Windows [EMAIL PROTECTED] wrote: Eclipse (I use 2.1) has an outline window that allows you to jump directly to subs. Hmm... Eclipse seems to be an umbrella name for a rather large project tree. Which specific component of Eclipse are you using--is it the Workbench? A quick glance at the docs shows no mention of perl. It seems to be java-centric--is Eclipse a bit overkill if you'd only be using it for perl? - Mark. ** This e-mail and any files transmitted with it are considered confidential and are intended solely for the use of the individual or entity to whom they are addressed (intended). This communication is subject to agent/client privilege. If you are not the intended recipient (received in error) or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please notify the sender immediately. ** ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Simple text editor under Windows
I use the Perl Dev Kit, which includes PerlApp for executables, and the Graphical debugger. Both can be set up and called as tools from Eclipse. If you have Komodo, do you not already have the separate debugger? John Wunderlich Project Manager, Privacy Ceridian Canada Ltd. 8777, Autoroute Transcanadienne Montreal, Quebec H4S 1Z6 Phone: 514.908.3094 Fax: 514.908.3119 eFax: 240.214.8893 We are what we repeatedly do. Excellence, therefore, is not an act, but a habit. Aristotle Thomas, Mark - BLS CTR [EMAIL PROTECTED] 03/03/2004 01:52 PM To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: RE: Simple text editor under Windows [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] wrote: The perl plug-ins are at: http://e-p-i-c.sourceforge.net/ Ah. Actually, that looks pretty good. I use Komodo now, and I like Komodo, but EPIC looks like it's getting pretty close in functionality. It seems to only lack a debugger :( As much as I'd love to have the subroutine list feature (and a _working_ method-assist feature), I don't think I'd want to sacrifice the nice visual debugger. I may give it a try though. Thanks for the info. -- Mark Thomas [EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; ** This e-mail and any files transmitted with it are considered confidential and are intended solely for the use of the individual or entity to whom they are addressed (intended). This communication is subject to agent/client privilege. If you are not the intended recipient (received in error) or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please notify the sender immediately. ** ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: OT: Script Review Process
Ed; I don't know that I'd want a code review on every script I write! I'm all for consistency and quality controls, but reviewing everything kind of takes away from one of the reasons that I use perl for in the first place. That being said, anything that I write that is for production use is put into a source control and versioning system (we use MKS, but whatever). That makes it visible to other developers, and allows for the how do we maintain it after he's run over by a bus problem. Major production systems are a product of team development and are peer reviewd. It works for us but TMTOWTDI John [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 2002/10/16 05:43 PM To:[EMAIL PROTECTED] cc: Subject:OT: Script Review Process My organization writes a lot of scripts - mostly, but not totally, in perl. Some of the stuff we do is quick and dirty one-time use and some of the code we write drives full-blown web applications. We also have varying degrees of skill and knowledge which of course leads to varying degrees of code quality. What we don't have, but would like to, is some sort of centralized code review committee to make sure that all our code is meeting some minimal level of quality. Does anyone out there have any sage wisdom to pass along or some good links to get me started? Thanks, Ed ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ** This e-mail and any files transmitted with it are considered confidential and are intended solely for the use of the individual or entity to whom they are addressed (intended). This communication is subject to agent/client privilege. If you are not the intended recipient (received in error) or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please notify the sender immediately. **
Glob question
I have a routine trying to rename files with patterns like this: From ABC to ABC.EXT When I do a @list = glob($filename) I get a nul return. I'm using File::Glob glob so that I can compile with Perl2Exe, if than makes any difference. Thanks, John ** This e-mail and any files transmitted with it are considered confidential and are intended solely for the use of the individual or entity to whom they are addressed (intended). This communication is subject to agent/client privilege. If you are not the intended recipient (received in error) or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please notify the sender immediately. **
Multi-level hashes and arrays
Hi; I need to know if I'm going about this the right way, or if I'm trying to reinvent a wheel that someone else has already got rolling. I'm writing a script that we are going to use to modify a series of files: 1. Each customer # may have a number of config files. 2. Each config files may have a number of entries(lines). I want to store all of this information in a dbm so that when we change config entries, we can have a record of the old and new versions. I thought that a hash like: $hashfilename{$custnum}{$configfilename}[linenuminfile] would work, but I can't seem to get it working. I can create the hash of arrays , but I can't load each of those hashes in to the top level. Is this syntax idiocy on my part or can this be done. My latest version looks like this: foreach (FILEIN) { print $_; $config{$custnum}-{$filename}-[$cnt]=$_; $cnt += 1; } Thanks in advance, John ** This e-mail and any files transmitted with it are considered confidential and are intended solely for the use of the individual or entity to whom they are addressed (intended). This communication is subject to agent/client privilege. If you are not the intended recipient (received in error) or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please notify the sender immediately. ** ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs