Re: parsing csv

2010-07-02 Thread Damon Allen Davison
On Fri, Jul 2, 2010 at 11:43 AM, Sharan Basappa wrote: > Hi Alan, > > I am not resisting installing but I am having trouble installing > Text::CSV module. > > I would be glad if someone helps with these errors ... Hi Sharan, You might find it a lot easier to install things if you use standard to

Re: parsing csv

2010-07-02 Thread Shlomi Fish
On Friday 02 Jul 2010 12:59:54 Sharan Basappa wrote: > Thanks a lot. I am now installing the module to try out and start > implementing my own code. > I think I will need help in installing the module ... > > This goes through fine: > perl Makefile.PL > Checking if your kit is complete... > Looks

Re: parsing csv

2010-07-02 Thread Alan Haggai Alavi
On 2 July 2010 15:56, Sharan Basappa wrote: > Hi Jason, > > Does CSV module come prebuilt so that I can avoid installing. > I dont know SQL but my requirements are very modest. > Extract lines and get filed and reformat them to another type. > > Regads, > Sharan Hi Sharan, DBD::CSV is not in co

Re: parsing csv

2010-07-02 Thread Sharan Basappa
Hi Alan, I am not resisting installing but I am having trouble installing Text::CSV module. I would be glad if someone helps with these errors ... perl Makefile.PL PREFIX=/home/sharan/tools/perl-install Checking if your kit is complete... Looks good Writing Makefile for Text::CSV_XS Make fails

Re: parsing csv

2010-07-02 Thread Sharan Basappa
SQL, I'd suggest you using DBI and DBD::CSV. > > Cheers, > Jason > >> Date: Fri, 2 Jul 2010 18:47:22 +1000 >> Subject: Re: parsing csv >> From: rc...@pcug.org.au >> To: sharan.basa...@gmail.com >> CC: beginners@perl.org >> >> >> &g

RE: parsing csv

2010-07-02 Thread Jason Feng
Hi there, If you know some SQL, I'd suggest you using DBI and DBD::CSV. Cheers, Jason > Date: Fri, 2 Jul 2010 18:47:22 +1000 > Subject: Re: parsing csv > From: rc...@pcug.org.au > To: sharan.basa...@gmail.com > CC: beginners@perl.org > > > > Folks, > &

Re: parsing csv

2010-07-02 Thread Sharan Basappa
Thanks a lot. I am now installing the module to try out and start implementing my own code. I think I will need help in installing the module ... This goes through fine: perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Text::CSV_XS Make fails: make cp CSV_XS.pm

Re: parsing csv

2010-07-02 Thread Shlomi Fish
On Friday 02 Jul 2010 11:55:47 Sharan Basappa wrote: > On Fri, Jul 2, 2010 at 2:19 PM, Shlomi Fish wrote: > > On Friday 02 Jul 2010 11:40:05 Sharan Basappa wrote: > >> Folks, > >> > >> I have to parse a csv file and convert it into some other format. > >> Can someone tell me what support perl has

Re: parsing csv

2010-07-02 Thread Sharan Basappa
On Fri, Jul 2, 2010 at 2:19 PM, Shlomi Fish wrote: > On Friday 02 Jul 2010 11:40:05 Sharan Basappa wrote: >> Folks, >> >> I have to parse a csv file and convert it into some other format. >> Can someone tell me what support perl has for csv parsing. >> My requirements are very modest, so somethng

Re: parsing csv

2010-07-02 Thread Shlomi Fish
On Friday 02 Jul 2010 11:40:05 Sharan Basappa wrote: > Folks, > > I have to parse a csv file and convert it into some other format. > Can someone tell me what support perl has for csv parsing. > My requirements are very modest, so somethng simple would be preferable. > See the page I prepared ab

Re: parsing csv

2010-07-02 Thread Owen
> Folks, > > I have to parse a csv file and convert it into some other format. > Can someone tell me what support perl has for csv parsing. > My requirements are very modest, so somethng simple would be > preferable. > > Regards, > Sharan You might want to search http://search.cpan.org/search?

Re: parsing csv

2010-07-02 Thread Damon Allen Davison
On 2 Jul 2010, at 09:40, Sharan Basappa wrote: > I have to parse a csv file and convert it into some other format. > Can someone tell me what support perl has for csv parsing. > My requirements are very modest, so somethng simple would be preferable. There is a module on CPAN for this. Using it

Re: parsing CSV files with control and extended ASCII characters

2008-05-06 Thread Jenda Krynicky
From: David Newman <[EMAIL PROTECTED]> > However, it doesn't answer the root question, namely how to parse text > that contains Western European characters such as accents and umlauts. > > I see from the Text::CSV documentation that this module handles only > characters between 0x20 and 0x7e. I

Re: parsing CSV files with control and extended ASCII characters

2008-05-06 Thread Gunnar Hjalmarsson
David Newman wrote: On 3/20/08 5:05 PM, Gunnar Hjalmarsson wrote: David Newman wrote: I have some CSV input files that contain control and extended ASCII characters, The Text::CSV or Tie::Handle::CSV modules don't like these characters; the snippets below both return errors when they get t

Re: parsing CSV files with control and extended ASCII characters

2008-05-06 Thread David Newman
On 3/20/08 5:05 PM, Gunnar Hjalmarsson wrote: David Newman wrote: I have some CSV input files that contain control and extended ASCII characters, The Text::CSV or Tie::Handle::CSV modules don't like these characters; the snippets below both return errors when they get to one. my $csv =

Re: parsing CSV files with control and extended ASCII characters

2008-03-20 Thread Gunnar Hjalmarsson
David Newman wrote: I have some CSV input files that contain control and extended ASCII characters, The Text::CSV or Tie::Handle::CSV modules don't like these characters; the snippets below both return errors when they get to one. my $csv = Text::CSV->new(); In the docs for Text::CSV,

Re: parsing csv-file for inserting in database

2007-09-19 Thread Chas Owens
On 9/19/07, Ruprecht Helms <[EMAIL PROTECTED]> wrote: > Chas Owens wrote: > > On 9/19/07, Ruprecht Helms <[EMAIL PROTECTED]> wrote: > >> #!/usr/bin/perl > > > > First off, you should use the strict and warnings pragmas. So the > > first two lines after the $! should be > > > > use strict; > > use

Re: parsing csv-file for inserting in database

2007-09-19 Thread Ruprecht Helms
Chas Owens wrote: > On 9/19/07, Ruprecht Helms <[EMAIL PROTECTED]> wrote: >> #!/usr/bin/perl > > First off, you should use the strict and warnings pragmas. So the > first two lines after the $! should be > > use strict; > use warnings; ... I inserted the two commands and get now these errors.

Re: parsing csv-file for inserting in database

2007-09-19 Thread Chas Owens
On 9/19/07, Ruprecht Helms <[EMAIL PROTECTED]> wrote: > #!/usr/bin/perl First off, you should use the strict and warnings pragmas. So the first two lines after the $! should be use strict; use warnings; > > open(CSV,"Kalkulation_Tauchsportportal.csv") || die "CSV-Datei nicht > gefunden"; > > $

Re: parsing csv-file for inserting in database

2007-09-19 Thread Ruprecht Helms
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

RE: parsing csv-file for inserting in database

2007-09-19 Thread Andrew Curry
@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

RE: parsing csv-file for inserting in database

2007-09-19 Thread Andrew Curry
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

2007-09-19 Thread Ruprecht Helms
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 expect

Re: parsing csv-file for inserting in database

2007-09-17 Thread Ken Foskey
On Mon, 2007-09-17 at 13:34 -0700, Jonathan Lang wrote: > Most of the replies have suggested using 'split( /\|/, $line )'. > However, this ignores a potentially important aspect of common cvs > file formats - well, important to me, anyway - which is the > interaction between quotes, field delimite

Re: parsing csv-file for inserting in database

2007-09-17 Thread Chas Owens
On 9/17/07, Jonathan Lang <[EMAIL PROTECTED]> wrote: snip > Most of the replies have suggested using 'split( /\|/, $line )'. > However, this ignores a potentially important aspect of common cvs > file formats - well, important to me, anyway - which is the > interaction between quotes, field delimit

Re: parsing csv-file for inserting in database

2007-09-17 Thread Jonathan Lang
Ruprecht Helms wrote: > Hi, > > how can I parse a csv-file where the entries are seperated with | . > The scripts later should put them into a mysql-database using dbi. > > Especially for me is interessting how to parse the content of the file > and store them into different variables for later pr

Re: parsing csv-file for inserting in database

2007-09-17 Thread Chas Owens
On 9/16/07, Ruprecht Helms <[EMAIL PROTECTED]> wrote: > Hi, > > how can I parse a csv-file where the entries are seperated with | . > The scripts later should put them into a mysql-database using dbi. > > Especially for me is interessting how to parse the content of the file > and store them into

Re: parsing csv-file for inserting in database

2007-09-16 Thread Ruprecht Helms
Hi Ken, >> how can I parse a csv-file where the entries are seperated with | . >> The scripts later should put them into a mysql-database using dbi. > > if it just splitting: > > @data = split( /\|/, $line ); I see you are working with array. The using of the for each-loop must be possible

Re: parsing csv-file for inserting in database

2007-09-16 Thread Ken Foskey
On Sun, 2007-09-16 at 12:28 +0200, Ruprecht Helms wrote: > Hi, > > how can I parse a csv-file where the entries are seperated with | . > The scripts later should put them into a mysql-database using dbi. if it just splitting: @data = split( /\|/, $line ); If you forget the backslash it wil

Re: Parsing .csv file

2003-06-25 Thread Todd Wade
"Dave Sparrow" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Take a look at Text::CSV or Text::CSV_XS > Ah, but here's the kicker... > Most people who I will give this script to will be running Perl 5.6 and WILL > NOT have the ability to use any external modules, even those such

RE: Parsing .csv file

2003-06-24 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Dave Sparrow wrote: >> Take a look at Text::CSV or Text::CSV_XS > Ah, but here's the kicker... > Most people who I will give this script to will be running Perl 5.6 and > WILL NOT have the ability to use any external modules, even those such as > 'use strict' ! > T

RE: Parsing .csv file

2003-06-24 Thread Sparrow, Dave
> Take a look at Text::CSV or Text::CSV_XS Ah, but here's the kicker... Most people who I will give this script to will be running Perl 5.6 and WILL NOT have the ability to use any external modules, even those such as 'use strict' ! This is because they will be running a cut-down version of Perl th

Re: Parsing .csv file

2003-06-24 Thread George P.
On Tue, 24 Jun 2003, Sparrow, Dave wrote: > I'm reading an Excel .csv file. > Fields are separated by commas. > If a field contains a comma, the whole field is double-quoted (Excel does > this by default). > An example of an input line is as follows: > > field1,field2,"field3a, field3b, field3c

RE: Parsing .csv file

2003-06-24 Thread Rai,Dharmender
you can get modules from cpan.perl.org > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > Confidential: This electronic message and all contents contain information from Syntel, Inc. whi

Re: Parsing .csv file

2003-06-24 Thread Sudarshan Raghavan
Sparrow, Dave wrote: I'm reading an Excel .csv file. Fields are separated by commas. If a field contains a comma, the whole field is double-quoted (Excel does this by default). An example of an input line is as follows: field1,field2,"field3a, field3b, field3c",field4,"field5a, field5c",field6