Thanks feherke,
I'm running awk that's supplied with Mac OS X 10.4.10. I think there was some hidden junk at the end of my file or something, because when i re-generated the input file, the awk script worked.
I agree a dedicated counter would be better than my crummy slow code!
wc works, but i...
Hi,
I have written a one-liner script to count the # of rows and coulmns for a file, like this:
% more dim
if [ $# -eq 0 ]
then
echo "Usage: dim filename"
exit
fi
awk 'BEGIN{FS="\t"} {nfe=NF} END{print NR " " nfe}' $1
This works fine on small files. e.g.
% dim smallfile.ped
2300...
Hi,
I'm a newbie to the forum & linux scripting in general, so i hope i'm posting the right place.
Problem: I have written a one-liner script to count the # of rows and coulmns for a file, like this:
% more dim
if [ $# -eq 0 ]
then
echo "Usage: dim filename"
exit
fi
awk...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.