The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Complex file count problem bbergstrom74 Shell Programming and Scripting 1 01-22-2008 12:16 PM
byte count and cut command hemangjani Shell Programming and Scripting 4 04-12-2007 11:32 AM
Word count problem ssmith001 UNIX for Dummies Questions & Answers 1 01-02-2007 01:21 PM
command to count files in dir balireddy_77 Shell Programming and Scripting 4 11-15-2006 01:56 AM
problem with count uni_ajay_r Shell Programming and Scripting 5 11-06-2006 08:14 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-27-2008
kunimi kunimi is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 8
Problem count with wc-l command

Hi All,

I'm trying to count how many line in my *.txt file.
My *.txt file has 1937 lines.
The problem is : when I use wc -l command
the result is 1936.

Again, I did some test. I create a new file with 100 lines with text editor (Notepad ++, Ultra edit).
And when I count it again with wc -l command, the result is 99.

Could someone help me ?

Thanks
Albasit
  #2 (permalink)  
Old 02-27-2008
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Erm, that shouldn't be happening. Can you open your file in 'vi' and see how many lines it has? The 'wc -l' command will count lines that have '\n' in them, so it won't generally report an incorrect count.
  #3 (permalink)  
Old 02-27-2008
kunimi kunimi is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 8
hi blowtorch,

thanks for the reply.
Ooo...I see..
I did "vi" my text file, and it has 1937 lines.
So, to make wc -l worked right, I have to make one blank line after the end of line.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0