MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Fix for EXCEL data import



******    message to minivend-users from Larry Leszczynski <larryl@furph.com>     ******

Hello -

I've appendeded a fix for Table/Import.pm for reading database files
exported from EXCEL.  The current version looks for quoted fields that
contain a comma, but doesn't find fields with doubled quotation marks
and no comma, like so:
   "This box is 24"" long by 12"" wide by 6"" deep."


Larry Leszczynski
larryl@furph.com
--
  furph, Inc.	WWW/Unix/Windows Solutions	734-513-7763 (voice)
info@furph.com	   http://www.furph.com		734-513-7759 (FAX)

=======================================================================
% diff -C3 Import.pm.orig Import.pm
*** Import.pm.orig      Tue Sep  1 09:15:57 1998
--- Import.pm   Tue Jan 19 10:27:41 1999
***************
*** 142,148 ****
  
        if($options->{EXCEL}) {
                $excel = <<'EndOfExcel';
!                       if(/"[^\t]*,/) {
                                for (@fields) {
                                        next unless /[,"]/;
                                        s/^"//;
--- 142,148 ----
  
        if($options->{EXCEL}) {
                $excel = <<'EndOfExcel';
!                       if(/"[^\t]*(?:,|"")/) {
                                for (@fields) {
                                        next unless /[,"]/;
                                        s/^"//;
***************
*** 152,158 ****
                        }
  EndOfExcel
                $excel_addl = <<'EndOfExcel';
!                       if(/"[^\t]*,/) {
                                for (@addl) {
                                        next unless /,/;
                                        s/^"//;
--- 152,158 ----
                        }
  EndOfExcel
                $excel_addl = <<'EndOfExcel';
!                       if(/"[^\t]*(?:,|"")/) {
                                for (@addl) {
                                        next unless /,/;
                                        s/^"//;
=======================================================================



-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: