# of rows and columns

Hi,

Does anyone know the command to know the # of rows and columns for a file?

thanks

depends on your 'file' (whatever it is) format.......

Hi.

There may be a better way, but...

awk 'NF > X { X = NF } END {print X, NR}' my_file

(assumung space as delimeter)

where X is the number of columns and NR is the number of records.

use awk -F to specify a delimeter if it's not a (white)space.

See here(example 9) for example (assuming space separated).