LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 02:39 AM   #1
Volcano
Member
 
Registered: Sep 2005
Posts: 225

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 02:41 AM.
 
Old 06-06-2007, 03:13 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

This is one way:

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

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

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

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, 05:19 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Oops......

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

Sorry about that!
 
  


Reply



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 06:43 AM
Integer Numbers in C Mercurius Programming 24 10-20-2005 09:54 AM
Integer To a String in C Bean101 Programming 2 05-27-2004 04:46 AM
Should posts in general count on your post count? Joey.Dale General 16 01-27-2004 01:31 AM
64 bit integer fahad153 Programming 9 08-26-2003 02:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:21 AM.

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
Open Source Consulting | Domain Registration