T
Thorsten Gottschalk
Hi all,
I want to have the awk NF variable in Perl. Yes I know there are many
hints for that. But I only found the folloing:
#!/usr/bin/perl
$ln="1;2;3;4;;;;;;10";
$nf = @records = split(/;/, $ln);
print "NF:$nf\n";
$"=";";
print "@records\n";
output:
NF:10
1;2;3;4;;;;;;10
so it looks good, now I change the script a little bit, look here:
# change this line in script:
$ln="1;2;3;4;;;;;;";
output:
NF:4
1;2;3;4
So now you can see the trick with spilt did not work any time. Are
there any other suggestions out there?
ciao
Thorsten
I want to have the awk NF variable in Perl. Yes I know there are many
hints for that. But I only found the folloing:
#!/usr/bin/perl
$ln="1;2;3;4;;;;;;10";
$nf = @records = split(/;/, $ln);
print "NF:$nf\n";
$"=";";
print "@records\n";
output:
NF:10
1;2;3;4;;;;;;10
so it looks good, now I change the script a little bit, look here:
# change this line in script:
$ln="1;2;3;4;;;;;;";
output:
NF:4
1;2;3;4
So now you can see the trick with spilt did not work any time. Are
there any other suggestions out there?
ciao
Thorsten