LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 06-06-2007, 03:39 AM   #1
Volcano
Member
 
Registered: Sep 2005
Posts: 159

Rep: Reputation: 15
want to get the integer value count


Input :

WC -l xyz.xml

output:

5000 xyz.xml




i dont want this output ...i need only 5000 .

How do i format my input command so that i can get output only 5000 ?

i just want to get the integer value count ..

Last edited by Volcano; 06-06-2007 at 03:41 AM.
 
Old 06-06-2007, 04:13 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

This is one way:

wc -l | awk '{ print $1 }'

Hope this helps.
 
Old 06-06-2007, 04:40 AM   #3
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 241Reputation: 241Reputation: 241
with bash
Code:
# set -- $(wc -l xyz.xml)
# echo $1
 
Old 06-06-2007, 05:12 AM   #4
Volcano
Member
 
Registered: Sep 2005
Posts: 159

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by druuna
Hi,

This is one way:

wc -l | awk '{ print $1 }'

Hope this helps.

confused ....where is the xyz.xml ?
 
Old 06-06-2007, 06:19 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Oops......

wc -l xyz.xml | awk '{ print $1 }'

Sorry about that!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
64 bit integer rajesh_b Programming 4 07-18-2006 07:43 AM
Integer Numbers in C Mercurius Programming 24 10-20-2005 10:54 AM
Integer To a String in C Bean101 Programming 2 05-27-2004 05:46 AM
Should posts in general count on your post count? Joey.Dale General 16 01-27-2004 02:31 AM
64 bit integer fahad153 Programming 9 08-26-2003 03:03 AM


All times are GMT -5. The time now is 03:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration