On Wed, Aug 26, 2009 at 02:23, Dave Tang wrote:
> Dear list,
>
> I am trying to import entries in a csv file into a relational database,
> however there are entries such as:
>
> a,b,c,d,e,"f1,f2","g1,g2" which spoil my split(/,/).
snip
Sounds like a job for [Text::CSV][1]. Of course, you an alway
> "DT" == Dave Tang writes:
DT> a,b,c,d,e,"f1,f2","g1,g2" which spoil my split(/,/).
DT> Could someone provide some guidance?
use a CSV module. parsing csv files is a pain with regexes (even if
doable). there are very stable and fast csv modules on cpan so get one
and use it.
uri
--
Dear list,
I am trying to import entries in a csv file into a relational database,
however there are entries such as:
a,b,c,d,e,"f1,f2","g1,g2" which spoil my split(/,/).
The quotes group f1 and f2 as a single entry. I know each each database
entry should be atomic, but I'll deal with that
You you put below word in "" Quote it treat as a string and if it kept in
single quote it treat as character so for the DNS(domain name space) it
should treat as charaterwies not as string so that it can read data from the
link
-Original Message-
From: Dr.Ruud [mailto:rvtol+use...@is
fzz wrote:
print "Latency to `one' is " . $ret->{'www.example.org'} . "\n";
Why is there a backquote in that string?
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
> -Original Message-
> From: Shawn H. Corey [mailto:shawnhco...@gmail.com]
> Sent: Monday, August 24, 2009 11:57
> To: Wagner, David --- Senior Programmer Analyst --- CFS
> Cc: Tony Esposito; Beginners Perl
> Subject: Re: one liner in Windows to replace string
>
> Wagner, David --- Senior
> -Original Message-
> From: Shawn H. Corey [mailto:shawnhco...@gmail.com]
> Sent: Monday, August 24, 2009 11:00
> To: Tony Esposito
> Cc: Beginners Perl
> Subject: Re: one liner in Windows to replace string
>
> Tony Esposito wrote:
> > perl -p -i.bak -e 's/CONSTANT/VARIABLE/' C:\test.txt
Gregory Machin wrote:
I'm writing a script to import logs into a Mysql .. My Perl is rusty
and I'm battling with a convention on the one column. I need to
remove the text in inverted commas "Prashil" 106 so that just the
number 106 remains.. I have been trying the following regex
s/(\"([^"]+)\
From: Tony Esposito [mailto:tony1234567...@yahoo.co.uk]
Sent: Monday, August 24, 2009 14:09
To: Shawn H. Corey
Cc: Wagner, David --- Senior Programmer Analyst --- CFS;
Beginners Perl
Subject: Re: one liner in Windows to repl
From: Tony Esposito [mailto:tony1234567...@yahoo.co.uk]
Sent: Monday, August 24, 2009 13:20
To: Shawn H. Corey; Wagner, David --- Senior Programmer Analyst
--- CFS
Cc: Beginners Perl
Subject: Re: one liner in Windows to repl
> -Original Message-
> From: Tony Esposito [mailto:tony1234567...@yahoo.co.uk]
> Sent: Monday, August 24, 2009 10:46
> To: Beginners Perl
> Cc: tony1234567...@yahoo.co.uk
> Subject: one liner in Windows to replace string
>
> perl -p -i.bak -e 's/CONSTANT/VARIABLE/' C:\test.txt
>
11 matches
Mail list logo