On 10/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> One of the column in csv file is Fri, Oct 12 10:32 AM. I am trying ti split 
> the csv file for checking a column value. when spliting I wanted to take Fri, 
> Oct 12 10:32 AM as a single value. How can I use split?
>
> Thanks
> Manoj

If the CVS uses a comma, you would split on the comma:
split /:/, $line;

As Tom said, if you only want the, say, 4rd field, you can use a RegEx:
$value = $1 if ( $line =~ /^(?:[^,]*,){3}([^,]*),/ );

Unfortunately, this gets messed up if a comma is anywhere present in
any of the fields, or if a field is more than one line (though I have
no idea if that's possible).

There is a CVS module you may want to search for on CPAN.

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


Reply via email to