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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Splitting file based on number of rows wahi80 Shell Programming and Scripting 2 06-03-2008 10:38 PM
Number Grouped Rows in File RacerX UNIX for Dummies Questions & Answers 2 03-03-2008 03:36 PM
Output number of rows inserted, updated... kushal_cog UNIX for Dummies Questions & Answers 0 01-30-2008 03:28 AM
return number of rows selected new2ss Shell Programming and Scripting 7 01-08-2007 10:46 AM
What is the Maximum number of characters that i can store in a variable? pcshan UNIX for Advanced & Expert Users 9 08-11-2004 06:25 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-28-2007
scabral scabral is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 2
Ability to store number of rows

Hi,

I am creating a korn shell script and i'm trying to find out what the total number of rows are in a specific text file and i need to store that number in a variable withing the script.

i know wc -l gives you the number, but it also has some leading spaces and then writes out the file name as well. All i need is the actual number or rows.

Also, i believe awk has the ability to return this value, but not sure how to store the value in a variable.

thanks
scott
 

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 06:43 AM.


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