Operating System - HP-UX
1833476 Members
2817 Online
110052 Solutions
New Discussion

Record Count and Word count ( HP and Solaris)

 
la_cool
Occasional Advisor

Record Count and Word count ( HP and Solaris)

When I do a record count I get file name and record count,
but I need just the record count and "not the file name"

however the problem in Solaris it has few spaces while in HP it does not.

Can someone assist in Both the Machines to just capture "RECORD COUNT and not file name"

3 REPLIES 3
Geoff Wild
Honored Contributor

Re: Record Count and Word count ( HP and Solaris)

wc file |awk '{print $1}'

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
harry d brown jr
Honored Contributor

Re: Record Count and Word count ( HP and Solaris)

# wc /tmp/vpart3_pm.txt | cut -d" " -f1-3
215 848 10446
#

live free or die
harry
Live Free or Die
John Poff
Honored Contributor

Re: Record Count and Word count ( HP and Solaris)

Hi,

Here is another way to do it. Just send the file as standard input to the 'wc' command:

wc -l 185


JP