TechTalkz.com Logo Ask the Expert

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Windows Powershell

Notices

get the number of lines in a text file

Microsoft Windows Powershell


Reply
 
Thread Tools Display Modes
Old 13-06-2008, 08:49 AM   #1
Jason1008
Guest
 
Posts: n/a
get the number of lines in a text file

What is the command to get only the number of lines in a text file
  Reply With Quote
Old 13-06-2008, 08:49 AM   #2
Tao Ma
Guest
 
Posts: n/a
Re: get the number of lines in a text file

Hi,

Try:
Measure-Object -Line

Tao Ma

"Jason1008" <Jason1008@discussions.microsoft.com> 写入消息新闻:3FD77F51-6A68-4CB3-AEB4-359945622150@microsoft.com...
> What is the command to get only the number of lines in a text file



  Reply With Quote
Old 13-06-2008, 08:49 AM   #3
Kiron
Guest
 
Posts: n/a
Re: get the number of lines in a text file

@(get-content .\file.txt -totalCount -1).count

# short version
@(gc .\file.txt -t -1).count

--
Kiron
  Reply With Quote
Reply

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 10:11 AM.


vBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2010, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional