Sponsored Content
Top Forums Shell Programming and Scripting Split large file and add header and footer to each file Post 302185448 by ashish4422 on Tuesday 15th of April 2008 03:26:50 AM
Old 04-15-2008
Split large file and add header and footer to each file

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file?
It is possible to add different header and footer to each file?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to Chop Header and Footer record from input file

Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks. (4 Replies)
Discussion started by: coolbudy
4 Replies

2. Shell Programming and Scripting

Total of lines w/out header and footer incude for a file

I am trying to get a total number of tapes w/out headers or footers in a ERV file and append it to the file. For some reason I cannot get it to work. Any ideas? #!/bin/sh dat=`date +"%b%d_%Y"` + date +%b%d_%Y dat=Nov16_2006 tapemgr="/export/home/legato/tapemgr/rpts"... (1 Reply)
Discussion started by: gzs553
1 Replies

3. Shell Programming and Scripting

Split large file and add header and footer to each small files

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (7 Replies)
Discussion started by: ashish4422
7 Replies

4. Shell Programming and Scripting

sort a report file having header and footer

I am having report file with header and footer . The details in between header and footer are separated by a pipe charater. I want to sort the file by considering multiple columns in between header and footer. pls help (4 Replies)
Discussion started by: suryanarayana
4 Replies

5. Shell Programming and Scripting

Add header and footer with record count in footer

This is my file(Target.txt) name|age|locaction abc|23|del xyz|24|mum jkl|25|kol The file should be like this 1|03252012 1|name|age|location 2|abc|23|del 2|xyz|24|mum 2|jkl|25|kol 2|kkk|26|hyd 3|4 Column 1 is row indicator for row 1 and 2, column indicator is 1,for data rows... (1 Reply)
Discussion started by: itsranjan
1 Replies

6. Shell Programming and Scripting

Removing header or footer from file

Hi Every one, what is the coomand to remove header or footer from a file. Please help me by providing command/syntax to remove header/footer from unix. Thanks in advance for all your support. (5 Replies)
Discussion started by: sridhardwh
5 Replies

7. Shell Programming and Scripting

Is there a way to append both at header and footer of a file

currently I've a file Insert into CD_CARD_TYPE (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE) Values ('024', '024', 2, sysdate); Insert into CD_CARD_TYPE (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE) Values ('032', '032', 2, sysdate); ........ is it... (3 Replies)
Discussion started by: jediwannabe
3 Replies

8. Shell Programming and Scripting

Split and add header and trailer from input file

I need to split the file based on pattern from position 34-37 while retaining the header and trailer records in each individual split file Also is it possible to output the TOM and PAT records in the same output file ? I need the output file names same as xyz_pattern_Datetimestamp.txt ... (23 Replies)
Discussion started by: techedipro
23 Replies

9. UNIX for Dummies Questions & Answers

Eliminate Header and footer from EBCDIC file

Is there any command to eliminate Header and footer from EBCDIC file (4 Replies)
Discussion started by: abhilashnair
4 Replies

10. Shell Programming and Scripting

Split large xml into mutiple files and with header and footer in file

Split large xml into mutiple files and with header and footer in file tried below it splits unevenly and also i need help in adding header and footer command : csplit -s -k -f my_XML_split.xml extrfile.xml "/<Document>/" {1} sample xml <?xml version="1.0" encoding="UTF-8"?><Recipient>... (36 Replies)
Discussion started by: karthik
36 Replies
NL(1)							    BSD General Commands Manual 						     NL(1)

NAME
nl -- line numbering filter SYNOPSIS
nl [-p] [-b type] [-d delim] [-f type] [-h type] [-i incr] [-l num] [-n format] [-s sep] [-v startnum] [-w width] [file] DESCRIPTION
The nl utility reads lines from the named file or the standard input if the file argument is ommitted, applies a configurable line numbering filter operation and writes the result to the standard output. The nl utility treats the text it reads in terms of logical pages. Unless specified otherwise, line numbering is reset at the start of each logical page. A logical page consists of a header, a body and a footer section; empty sections are valid. Different line numbering options are independently available for header, body and footer sections. The starts of logical page sections are signalled by input lines containing nothing but one of the following sequences of delimiter charac- ters: Line Start of ::: header :: body : footer If the input does not contain any logical page section signalling directives, the text being read is assumed to consist of a single logical page body. The following options are available: -b type Specify the logical page body lines to be numbered. Recognized type arguments are: a Number all lines. t Number only non-empty lines. n No line numbering. pexpr Number only those lines that contain the basic regular expression specified by expr. The default type for logical page body lines is t. -d delim Specify the delimiter characters used to indicate the start of a logical page section in the input file. At most two characters may be specified; if only one character is specified, the first character is replaced and the second character remains unchanged. The default delim characters are ``:''. -f type Specify the same as -b type except for logical page footer lines. The default type for logical page footer lines is n. -h type Specify the same as -b type except for logical page header lines. The default type for logical page header lines is n. -i incr Specify the increment value used to number logical page lines. The default incr value is 1. -l num If numbering of all lines is specified for the current logical section using the corresponding -b a, -f a or -h a option, spec- ify the number of adjacent blank lines to be considered as one. For example, -l 2 results in only the second adjacent blank line being numbered. The default num value is 1. -n format Specify the line numbering output format. Recognized format arguments are: ln Left justified. rn Right justified, leading zeros suppressed. rz Right justified, leading zeros kept. The default format is rn. -p Specify that line numbering should not be restarted at logical page delimiters. -s sep Specify the characters used in separating the line number and the corresponding text line. The default sep setting is a single tab character. -v startnum Specify the initial value used to number logical page lines; see also the description of the -p option. The default startnum value is 1. -w width Specify the number of characters to be occupied by the line number; in case the width is insufficient to hold the line number, it will be truncated to its width least significant digits. The default width is 6. ENVIRONMENT
The LANG, LC_ALL, LC_CTYPE and LC_COLLATE environment variables affect the execution of nl as described in environ(7). EXIT STATUS
The nl utility exits 0 on success, and >0 if an error occurs. SEE ALSO
jot(1), pr(1) STANDARDS
The nl utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
The nl utility first appeared in AT&T System V Release 2 UNIX. BUGS
Input lines are limited to LINE_MAX (2048) bytes in length. BSD
January 26, 2005 BSD
All times are GMT -4. The time now is 03:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy