Search Results

Search: Posts Made By: ctsgnb
2,834
Posted By ctsgnb
# printf "%s\t%s\t%s\t%s\t%s\n" "" a b c d && awk...
# printf "%s\t%s\t%s\t%s\t%s\n" "" a b c d && awk 'NR>1{for (i=1;i<NF+1;i++) {I[$i]=$i;++J[$i]};A[$1]=($1==0)?1:$1;B[$2]=($2==0)?1:$2;C[$3]=($3==0)?1:$3;D[$4]=($4==0)?1:$4}END{for (j in I) print...
2,834
Posted By ctsgnb
Note that my solution scan the file only once ......
Note that my solution scan the file only once ... less I/O !
2,834
Posted By ctsgnb
printf "%s\t%s\t%s\t%s\t%s\n" "" a b c d|Display...
printf "%s\t%s\t%s\t%s\t%s\n" "" a b c d|Display the first line using \t as <tab> separator and \n for a newline
&&|logical "AND" : if left side got processed with return code 0, then process right...
2,834
Posted By ctsgnb
# cat tst a b c d 0 0 0 0 ...
# cat tst
a b c d
0 0 0 0
1 2 1 2
2 5 3 4
3 8 4 6
4 10 9 8
5 15 8 10
# printf "%s\t%s\t%s\t%s\t%s\n" "" a b c d && awk 'NR>1{for...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 06:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy