I'm parsing through a csv file one line at a time and I need to check each line and truncate anything over 199 entries. I would prefer to stick with the core libraries because if possible!
@tmp = split /\,/, $_;
$count = $#tmp <= 198 ? $#tmp : 198;
$line = "";
for $num (0..$count) {
$line .= "$tmp[$num],";
}
print "$line\n";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It
@tmp = split /\,/, $_;
$count = $#tmp <= 198 ? $#tmp : 198;
$line = "";
for $num (0..$count) {
$line .= "$tmp[$num],";
}
print "$line\n";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It