open(CSV,"Kalkulation_Tauchsportportal.csv") || die "CSV-Datei nicht
gefunden\"; you have \ your "  

-----Original Message-----
From: Ruprecht Helms [mailto:[EMAIL PROTECTED] 
Sent: 19 September 2007 10:40
To: Chas Owens
Cc: Jonathan Lang; beginners@perl.org
Subject: Re: parsing csv-file for inserting in database

Hi,

On running the script I get the following errors:

Scalar found where operator expected at ./csv_auslesen.pl line 29, near
"pint Auftrag "$Datenfelder"
  (Might be a runaway multi-line "" string starting on line 3)
        (Do you need to predeclare pint?) Backslash found where operator
expected at ./csv_auslesen.pl line 29, near "]\"
        (Missing operator before \?)
String found where operator expected at ./csv_auslesen.pl line 34, near
"print $Anzahl,""
  (Might be a runaway multi-line "" string starting on line 29)
        (Missing semicolon on previous line?) Bareword found where operator
expected at ./csv_auslesen.pl line 34, near "print $Anzahl," Datensaetze"
        (Do you need to predeclare print?) String found where operator
expected at ./csv_auslesen.pl line 34, at end of line
        (Missing semicolon on previous line?) syntax error at
./csv_auslesen.pl line 29, near "pint Auftrag "$Datenfelder"
Can't find string terminator '"' anywhere before EOF at ./csv_auslesen.pl
line 34.

---------------

The code is:

#!/usr/bin/perl

open(CSV,"Kalkulation_Tauchsportportal.csv") || die "CSV-Datei nicht
gefunden\";

$i=0;

while (<CSV>)
{
        if($i==0)
        {
                $Felder = $_;
        }
        else
        {
                @Auftraege[$i] = $_;
        }
        $i++;
}
close(<CS>);
$Anzahl = $i - 1;
chop($Felder);
@Datenfelder = split(/,|,$Felder);
for(@Auftraege)
{
        @Datensatz = split(/,|,/,$_);
        $i = 0;
        for(@Datensatz)
        {
                pint Auftrag "$Datenfelder[$i]: $Datensatz[$i]\n";
                $i++
        }
}
close (Auftrag);
print $Anzahl," Datensaetze geschrieben\n";
--------------------
Whats getting wrong?

Regards,
Ruprecht Helms

Web: http://www.rheyn.de

--
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/



This e-mail is from the PA Group.  For more information, see
www.thepagroup.com.

This e-mail may contain confidential information.  Only the addressee is
permitted to read, copy, distribute or otherwise use this email or any
attachments.  If you have received it in error, please contact the sender
immediately.  Any opinion expressed in this e-mail is personal to the sender
and may not reflect the opinion of the PA Group.

Any e-mail reply to this address may be subject to interception or
monitoring for operational reasons or for lawful business practices.





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to