Link to home
Start Free TrialLog in
Avatar of Europa MacDonald
Europa MacDonaldFlag for United Kingdom of Great Britain and Northern Ireland

asked on

sorting output with tab spaces rather than commas

is it possible to delineate output with tab spaces rather than using commas
eg
322,345,432,455,655,677,899,540 to        322    345   432   455   655   677   899   540  

I am using this code :

print OUT "$n1,$n2,$n3,$n4,$n5,$n6,$n7,",(floor $avg),"\n";
ASKER CERTIFIED SOLUTION
Avatar of Suhas .
Suhas .
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
print join("\t",$n1,$n2,$n3,$n4,$n5,$n6,$n7,floor $avg),"\n"';
print join(",",$n1,$n2,$n3,$n4,$n5,$n6,$n7,floor $avg),"\n"';
$, = "\t";
print $n1,$n2,$n3,$n4,$n5,$n6,$n7,floor $avg;
$, = ",";
print $n1,$n2,$n3,$n4,$n5,$n6,$n7,floor $avg;
Avatar of Europa MacDonald

ASKER

thankyou
#print join("\t",$n1,$n2,$n3,$n4,$n5,$n6,$n7,floor $avg),"\n"';
#print join(",",$n1,$n2,$n3,$n4,$n5,$n6,$n7,floor $avg),"\n"';
#sorry, I left an extra character in
print join("\t",$n1,$n2,$n3,$n4,$n5,$n6,$n7,floor $avg),"\n";
#and
print join("\t",$n1,$n2,$n3,$n4,$n5,$n6,$n7,floor $avg),"\n";
print join . . .

doesnt seem to want to work
print join("\t",$n1,$n2,$n3,$n4,$n5,$n6,$n7,floor $avg),"\n";
#and
print join(",",$n1,$n2,$n3,$n4,$n5,$n6,$n7,floor $avg),"\n";
You could also replace the commas with tabs, but in a comment, it's difficult to distinguish tabs from spaces