Link to home
Start Free TrialLog in
Avatar of GP7
GP7

asked on

how to grep number of rows in vi

Hi,

What is the command to grep number of rows in vi editor? i need to grep the number of records from a log file. each record has a lot of cols which extend upto many lines. now i want to grep the number of records... not lines.

Thanks
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Try <Ctrl><g>
(press  Ctrl and  g simultaneously. Do not press colon  :   !)
You will see a message "The cursor is at line l of n --- xx % ---",  or "n lines -- x% --"
with n being the number of rows in the file.
wmp
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates 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
Avatar of GP7
GP7

ASKER

Thanks
What was wrong with my answer? <ESC><Ctrl><g> is much faster to type than <ESC><:>set nu<enter><:><$><enter>