We're using FedEx as our shipper. Their label printer limits us to 35 characters per address line. My co-workers are I are discussing about splitting the address line into a second address line if the first line goes over the 35 char limit. We're also running into this issue when using their Address Validation Service.
I'm curious, how have other people handled the 35 character limit?
Thanks in advance!
EDIT
Posting the solution I developed so it may help someone else (written for Perl and variable names changed to protect the innocent).
# handle too long strings
my $street1_string = sprintf( "%s", $ShipTo_Street_Line1 ) );
my $street2_string = sprintf( "%s", $ShipTo_Street_Line2 ) );
my $street1_final;
my $street2_final;
my $street1_length = length($street1_string);
my $last_space_pos = rindex($street1_string, ' ');
# find and split on last space less than 35 characters
while($last_space_pos >= 35)
{
if ($last_space_pos < 35)
{
break;
}
$last_space_pos = rindex($street1_string, ' ', $last_space_pos-1);
}
$street1_final = substr($street1_string, 0, $last_space_pos);
$street2_final = substr($street1_string, $last_space_pos+1, $street1_length) . ' ' . $street2_string;