Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Adding header to an existing file Post 302217847 by Vi-Curious on Wednesday 23rd of July 2008 08:02:10 PM
Old 07-23-2008
If this is something you will need to do repeatedly, I suppose you could try something with an ex script. If you had something like this in a file named addhdr:
Code:
 
1i
this is what my header will be
.
x

And you would run it like this:
Code:
 
ex - myreallybigfile < addhdr

 

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
PPTEMPLATE(1)						User Contributed Perl Documentation					     PPTEMPLATE(1)

NAME
pptemplate - script to generate Makefile.PL and PP file skeleton SYNOPSIS
# generate Makefile.PL and mymodule.pd in CWD pptemplate PDL::MyModule; DESCRIPTION
The pptemplate script is the easiest way to start a new module for PDL that contains PP code (see also PDL::PP). The usage is simply pptemplate modulename; As a result pptemplate will generate a perl Makefile for the new module (Makefile.PL) that contains the minimal structure to generate a module from PP code and also a skeleton file for your new module. The file will be called mymod.pd if you called "pptemplate" as pptemplate PDL::CleverAlgs::Mymod; I suppose you can work out the naming rule ";)". If not resort to experimentation or the source code. "pptemplate" will refuse to overwrite existing files of the same name to avoid accidents. Move them out of the way if you really want to scrap them. Options Currently there is only the "-i" option which switches "pptemplate" into the so called internal mode. It should only be used when you are starting a new module within the main PDL tree that is supposed to be part of the PDL distribution and the normal PDL build process, e.g. cd PDL/IO; mkdir Mpthree; cd Mpthree; pptemplate -i PDL::IO::Mpthree; BUGS
Maybe ";)". Feedback and bug reports are welcome. COPYRIGHT
Copyright (c) 2001, Christian Soeller. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as PDL itself (see http://pdl.perl.org). perl v5.12.1 2010-07-05 PPTEMPLATE(1)
All times are GMT -4. The time now is 06:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy