Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Adding header to an existing file Post 302217704 by shash on Wednesday 23rd of July 2008 10:35:56 AM
Old 07-23-2008
Thanks for the reply sysgate. But, I don't want to create a new file.
Is there a way I can add the header in the existing file itself.

Thanks
Shash
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Help for Adding Three new columns in existing file from fatching data from file

not required this time (36 Replies)
Discussion started by: Sandeep_Malik
36 Replies

2. Shell Programming and Scripting

Adding file to an existing tar

Hi Friends, I want to know the command to add a new file in a existing tar file. For Ex: I have a tar file file1.tar with the contents one.txt two.txt three.txt Now I need to add file four.txt to this existing tar file, how can I do it? Thanks in advance (4 Replies)
Discussion started by: mr_manii
4 Replies

3. UNIX for Dummies Questions & Answers

Adding a header to a log file

Hello, I’m trying to add a row that will server as the header for a space separated file. 1-I have a number of files save in a directory 2- grep text path/*.log > newfile newfile looks like this Field1 Field2 Field3 Field4 Field1 Field2 Field3 Field4 Field1 Field2 Field3 Field4 Field1... (2 Replies)
Discussion started by: rene reivera jr
2 Replies

4. Shell Programming and Scripting

Adding a new column in a file with other existing columns

Hi All , Kindly help me with this soln awk '{printf "%s %7s \n", $1,$c}' infile where value of variable c I am externally giving input But executing the above command shows all the columns of infile where as I want only 1st column of infile and 2nd column should print value c (8 Replies)
Discussion started by: Pratik4891
8 Replies

5. Shell Programming and Scripting

Adding existing set of records in the same file

I have a file with 50,000 records in it, i have a requirement to use the same 50,000 records and add them 4 times to the same file to make a total of 200,000 records. I was wondering how to do this using ksh. Any help is greatly appreciated. (2 Replies)
Discussion started by: vpv0002
2 Replies

6. Shell Programming and Scripting

Adding Header and Trailer records to a appended file

How can we a shell script and pass date parameters .I have 3 files comming from Datastage with |" delimited I need append 3 files as above: File1: P0000|"47416954|"AU|"000|"INS|"0000|"|"20060601|"99991231|"|"|"|"|"01 File 2:... (2 Replies)
Discussion started by: e1994264
2 Replies

7. UNIX for Dummies Questions & Answers

Adding header and trailer into a file

Hi, I want to add the below Header to all the files in sequence File1,File2,File3...etc "ABC,<number of chracter in the file>" e,g - If File1 is as below pqrstuvdt abcdefgh then I want to add the above header into it ,So that File1 becomes as below ABC,17 pqrstuvdt abcdefgh ... (9 Replies)
Discussion started by: spari2
9 Replies

8. Shell Programming and Scripting

adding header in a file

Hi team, In my script i am storing some value in a variable "header". I want to add the header value has header in a file. Please help me on this Thanks in advance, Baski (4 Replies)
Discussion started by: baskivs
4 Replies

9. Shell Programming and Scripting

Need help in adding header of a file

Hi All , I have a pipe dilimited file .Sample file is below.I need to add header in that file through unix. 000001| 1|AQWWW|234,456.00 | | 123456| |41|abC| 0|xyZ| 000002| 2|11 4|1,234,456.99| | 0| |23| |99|! | 000003| 3|!!@#$|0,000,001.10| | ... (4 Replies)
Discussion started by: STCET22
4 Replies

10. Shell Programming and Scripting

Python DictWriter header - not writing in first line of existing file

Hello I am facing a very unique problem and not able to understand why. I have written a function which will check header of the file. If header is present good else it will write the header on top def writeHeaderOutputCSV(fileName): # See if the file exist already try: ... (0 Replies)
Discussion started by: radioactive9
0 Replies
dist(1) 						      General Commands Manual							   dist(1)

NAME
dist - redistribute a message to additional addresses (only available within the message handling system, mh) SYNOPSIS
dist [msg] [+folder] [options] OPTIONS
Annotates the message that you are redistributing. The following lines are added to the message that you are redistributing: Resent: date Resent: addrs The first line records the time at which the message was redistributed; the second records the addresses of the recipients of the redistributed message. The dist command only annotates messages when they are successfully sent. If you do not send the message immediately and file the unsent draft, it will not be annotated. Specifies the folder in which the draft message is created. If you do not send the draft, the mail system will store it in this folder. This option is usually set up in your See mh_profile(4) for more information. If you have this option set up, you can override it by using the -nodraftfolder option. Specifies the file in which the draft message is created. If no absolute pathname is given, the file is assumed to be in your Mail directory, standardly $HOME/Mail. If you do not send the message, it is stored in the named file until you delete it, or send it at a later date. Specifies the editor that you want to use to edit your forwarded message. You can also set up an editor in your file; see mh_profile(4) for more information. Specifies the message header to be used in the draft message. If this option is present, dist takes the header of the draft message from the named file. If this option is not present, the header is taken from the distcomps file in your Mail directory, or failing that, from the mail system default header. Causes annotation to be done in place, to preserve links to the annotated message. This option only works with the -annotate option. Prints a list of the valid options for this command. Suppresses editing of the draft message altogether. Specifies an alternative whatnow program. Normally, dist invokes the default whatnow program. See whatnow(1) for a discussion of available options. You can specify your own alternative to the default program using the -whatnowproc program option. If you do specify your own program, you should not call it whatnow. You can suppress the whatnow program entirely by using the -nowhatnowproc option. However, as the program normally starts the ini- tial edit, the -nowhatnowproc option will prevent you from editing the message. The defaults for dist are: +folder defaults to the current folder msg defaults to cur -noannotate -nodraftfolder -noinplace DESCRIPTION
Use dist to redistribute a message to addresses that are not on the original address list. You can specify the message which you want to redistribute by giving a message number as the msg argument. If you do not supply a message number, dist takes the current message. You can only redistribute one message at a time. You can also specify a message in another folder by giving the +folder argument. This argument can be used in conjunction with the msg argument. The program dist is similar to forw. The main difference between the two commands is that forw encapsulates the message, whereas dist merely resends it. You cannot add any new text of your own to a message that you re-distribute using dist. A message that has been for- warded will appear to have been sent by the person who forwarded the message. A message that has been redistributed using dist will appear to have come from the sender of the original message. This is shown in the scan listing of the messages. In the following example, messages 1 and 2 are identical apart from the method used to send the message on to additional recipients: 1 20/06 goodman Hello <<As you will see from th 2+ 21/06 John As previous, but forwarded <<--- When you use dist, you will get a message form to fill in with the details of the additional recipients. The default message form contains the following elements: Resent-To: Resent-cc: If the file named dist comps exists in your Mail directory, standardly $HOME/Mail, it is used instead of the standard mail header. If the option -form formfile is given, it overrides both of these. You can only put recognized header lines in your message form. The dist program recognizes values in the following fields: Resent-To: Resent-cc: Resent-Bcc: Resent-Fcc: Resent-Xmts: The headers and the body of the original message are copied to the draft when the message is sent. You cannot add any new body text of your own when redistributing a message with dist. If you do not have a draft folder set up, dist creates the message form in a file called draft in your Mail directory. This file must be empty before you can create a new draft, which means that you can only store one draft at a time. If it is not empty, the mail system asks you what you want to do with the existing contents. The options are: Aborts dist, leaving the draft intact. Replaces the existing draft with the appropriate message form. Displays the draft message. Refiles the existing draft message in the specified folder, and provides a new message form for you to complete. If you want to be able to have more than one draft at a time, you can set up a draft folder in your you to keep as many unsent drafts as space allows, and still create new messages as you wish. To do this, make sure that the following line is in your Draft-folder: +drafts For more information on how to do this, see mh_profile(4). You cannot store unsent messages created using dist in your draft folder. If you attempt to do so, only the message form is stored. This does not contain the original message that you are redistributing, so you will not be able to send it later. If you use repl to reply to a message resent to you by dist, the reply will go to the sender of the original message, rather than the per- son who forwarded it to you. The repl command ignores the Resent-xxx: fields when creating the header for your draft reply. PROFILE COMPONENTS
Path: To determine your Mail directory (<mh-dir>) Draft-Folder: To find the default draft folder Editor: To override the default editor fileproc: Program to refile the message whatnowproc: Program to ask the What now? questions FILES
The default system template for re-distributed messages. The user-supplied alternative to the default system template. The user profile. The draft file. SEE ALSO
comp(1), forw(1), repl(1), send(1), whatnow(1) dist(1)
All times are GMT -4. The time now is 03:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy