Quote:
Originally Posted by sayhello_to_the_world
how to counting the rows see the example..
shop name
supermarket Netto
supermarket Penny
supermarket Rewe
supermarket netto
supermarket Lidl
supermarket Netto
is there an easy way to do this
|
There are several ways to do this, but you don't tell us what you're wanting to use. Perl? Bash? Ruby? What is your delimiter between the 'rows'? What have you done/tried on your own?? What are you trying to accomplish?
You can easily use sed and awk to get the maximum number of columns, by counting the delimiters. Running it through sort and head would return just the highest number.
Code:
sed 's/[^<some delimiter>]//g' <file name> | awk '{ print length }' | sort -r | head -n 1
Please try to show some effort of your own first.