The UNIX and Linux Forums  

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
Adding a columnfrom a specifit line number to a specific line number Ezy Shell Programming and Scripting 2 05-12-2008 05:29 AM
generating line numbers sam4now Shell Programming and Scripting 7 04-28-2008 03:17 PM
Appending line number to each line and getting total number of lines chiru_h Shell Programming and Scripting 2 03-25-2008 07:19 AM
Unix Script with line number at beginning of each line. mascorro Shell Programming and Scripting 5 06-19-2006 01:34 PM
identifying duplicates line & reporting their line number stresslog UNIX for Dummies Questions & Answers 5 04-23-2006 09:43 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 07-08-2008
Registered User
 

Join Date: Oct 2007
Posts: 21
Generating line number

Hi,

I am generating a file through some Datastage commands:


cat $TempDir/stage.txt |while read line
do
stagename=`echo $line`
dsjob -llinks $proj $jobname $stagename 2>/dev/null >> $TempDir/LinkName.txt

Now i have to assign the number to the columns generated in Linkname.txt file..How can i achieve this?

Thanks in Advance!
Reply With Quote
Forum Sponsor
  #2  
Old 07-08-2008
Moderator
 

Join Date: Sep 2007
Location: Germany
Posts: 958
Post a snippet of the input and desired output. My telephatic powers are a still a bit down that early in the morning without a cup of coffee
Reply With Quote
  #3  
Old 07-09-2008
Registered User
 

Join Date: Oct 2007
Posts: 21
Hi,
My file is
DSLink43
DSLink46
DSLink48
DSLink46
DSLink46
DSLink44

My desired ouput is:
1.DSLink43
2.DSLink46
3.DSLink48
4.DSLink46
5.DSLink46
6.DSLink44

Thanks In Advance!
Reply With Quote
  #4  
Old 07-09-2008
Registered User
 

Join Date: Mar 2008
Location: /bin/sh
Posts: 352
Thumbs up

Code:
cat -n file-name > new_file
Reply With Quote
  #5  
Old 07-09-2008
Registered User
 

Join Date: Oct 2007
Posts: 21
Quote:
Originally Posted by nua7 View Post
Code:
cat -n file-name > new_file
Thanks!
Reply With Quote
  #6  
Old 07-09-2008
radoulov's Avatar
addict
 

Join Date: Jan 2007
Location: Milano, Italia/Варна, България
Posts: 1,857
Or:

Code:
nl file>new
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0