The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Trying to empty file using > but the file size increasing when next append firdousamir UNIX for Dummies Questions & Answers 4 06-23-2008 12:37 AM
How to append to the file? vinay123 Shell Programming and Scripting 9 06-16-2008 12:20 PM
append file name contents to a target file gopskrish UNIX for Dummies Questions & Answers 2 10-27-2006 03:18 AM
Append a field to the end of each line of a file based on searching another file. ultimate Shell Programming and Scripting 2 03-29-2005 07:21 AM
Is there any way to append pdf files in UNIX? cp7800 Shell Programming and Scripting 2 03-19-2002 07:16 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-17-2008
Registered User
 

Join Date: Jul 2008
Posts: 5
Append the file in UNIX

Hello All,

Could you please provide the solution to my following query
I have some files in my directory. I need to amend the total number of
lines to be added in the starting
line of each file.

For example, please refer the content of the file "file.dat" below.

\h:\w #> cat file.dat
hai
hello
end
Nice day
\h:\w #>

After your command, the output should be below.

\h:\w #> cat file.dat
Total no. of lines: 4
hai
hello
end
Nice day
\h:\w #>

We can do this in sed and awk through a single command. But we will
avoid the sed and awk stuff's for some time.
and can just try using simple unix commands for now.

Regards,
Sandeep
Forum Sponsor
  #2  
Old 07-17-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,297
This is homework. Please do not post homework.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:15 PM.


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