[EMAIL PROTECTED] wrote:
> I am working with huge ASCII text files and large text fields.
> 
> As needs and wants have changed, I will be reprocessing data we have
> already gone through to see if more records can be extracted.
> 
> I will need to compare strings to ensure that records I am inserting
> into our SQL Sever 2000 database are not duplicates of records already
> there.
> 
> I have come up with two ways:
> 
> (1) use string length (number of characters a string holds):
> 
> $length = length($name);
> 
> If both strings are identical in length, I have a duplicate and would
> cease processing.
> 
> (2) compare strings (or 200-characer substrings thereof) directly:
> 
> if ( $str1 eq $str2 )
> {
>     ....
> }
> 
        The string compare should not be that big a thing.  I would believe 
that you would have duplicate lengths since the size of your field you are 
talking about is only 200 characters.

        Use Benchmark if you have questions on what you are doing and you can 
see the time ( wallclock and amount of cpu time ) required to do a certain 
action.

Wags ;)
> 
> Does this sound sane to you folks? If anyone has a better way, don't
> be shy. 
> 
> -- Craig
> 
> 
> ---
> avast! Antivirus: Outbound message clean.
> Virus Database (VPS): 0515-0, 04/11/2005
> Tested on: 4/11/2005 2:22:59 PM
> avast! - copyright (c) 1988-2004 ALWIL Software.
> http://www.avast.com
> 
> 
> 
> _______________________________________________
> ActivePerl mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to