![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Split large file and add header and footer to each file | ashish4422 | Shell Programming and Scripting | 1 | 04-15-2008 06:12 AM |
| Reading the header of a tar file(posix header) | Tanvirk | Linux | 2 | 01-31-2008 08:50 AM |
| How to retain file permissions during FTP on Solaris 5.9 ? | gauravsachan | UNIX for Advanced & Expert Users | 3 | 04-26-2007 10:19 AM |
| parse an arpwatch file and retain most recent mac | CM64 | Shell Programming and Scripting | 8 | 04-12-2007 12:21 AM |
| request_irq func. header file? | ppphah | High Level Programming | 2 | 11-16-2002 04:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to retain the header information of a file
Hi,
I am using Bash shell to create some data and these data would be piped out to a file, let say output.txt. This output.txt I would like to add some extra header information such as comments, descriptions and general information on the text. I would like to know how could I maintain this type of information. I did try out using append to a file. In other word,I created a file with initial description and comments on it. Then, these data I would append (using << output.txt). However, one limitation of this is that the data would be keep adding on top of the file each time repeated command are executed. Anyone have idea to solve this? Besides, another problem is by having this header, I would like to further extract the data from the output.txt without the description and comments. I tried using head and tail but it doesnt work automatically. In other words, let say description and comment I have as first 5 lines of the output.txt. Currently I extract out these data using cat output.txt|..<all the operation>. But I could not help but extracting the first 5 lines as well. Please advise. Appreciate alot. Thanks. -Jason |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|