$columns = 1; $rows = 0;
while ($line = <>) {
chomp $line;
@chars = split(//, $line);
for ($i=0; $i<>
if ( ord($chars[$i]) == 9 ) { $columns++; }
}
$rows++;
}>>NA or NaN values, accordingly. Since you're working with your files one line at a time, you wouldn't need as much memory with this approach.$ perl -MCPAN -e shellcpan> install Snail::CSV$columns = 1; $rows = 0;
while ($line = <>) {
chomp $line;
@chars = split(//, $line);
for ($i=0; $i<=$#chars; $i++) {
if ( ord($chars[$i]) == 9 ) { $columns++; }
}
$rows++;
}You are not logged in, either login or create an account to post comments
posted by wrok at 1:28 PM on February 5