@Datenfelder = split(/,,,$Felder); Guessing this line. Split (//,$string) -----Original Message----- From: Ruprecht Helms [mailto:[EMAIL PROTECTED] Sent: 19 September 2007 15:00 To: Andrew Curry Cc: Chas Owens; Jonathan Lang; beginners@perl.org Subject: Re: parsing csv-file for inserting in database
Andrew Curry wrote: > open(CSV,"Kalkulation_Tauchsportportal.csv") || die "CSV-Datei nicht > gefunden\"; you have \ your " Ok I corrected it, now I only have an syntax-error in line 25 (split-command). In addition i am told that the part is not terminated. The actual 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(CSV); $Anzahl = $i - 1; chop($Felder); @Datenfelder = split(/,,,$Felder); for(@Auftraege) { @Datensatz = split(/,:,/,$_); $i = 0; for(@Datensatz) { print Auftrag "$Datenfelder[$i]: $Datensatz[$i]\n"; $i++; } } close (Auftrag); print $Anzahl," Datensaetze geschrieben\n"; -------------------- By leaving the / I get more errors. What's wrong? Regards, Ruprecht Web: http://www.rheyn.de 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/