Sponsored Content
Top Forums Shell Programming and Scripting Specific Header after every 30 records Post 302592234 by srk409 on Monday 23rd of January 2012 10:22:38 AM
Old 01-23-2012
Specific Header after every 30 records

Hi All,

I have got a requirement.
I have a source file, EMPFULL.txt and I need to split the data for every 30 records
and place a Typical Header as below with system and page number too.
Code:
2012.01.03                    Employee Dept  Report                             1
...################################################################################
...# EmpNo   #Id/Number  #Deptid #Departmetname                                #Pro
...#
...################################################################################
Record1
Record2
.
.
Record30
2012.01.03                    Employee Dept  Report                             2
...################################################################################
...# EmpNo   #Id/Number  #Deptid #Departmetname                                #Pro
...#
...################################################################################
Record31
Record32
.
.
Record60
2012.01.03                    Employee Dept  Report                             3
...################################################################################
...# EmpNo   #Id/Number  #Deptid #Departmetname                                #Pro
...#
...################################################################################
.
.
.
.
.
2012.01.03                    Employee Dept  Report                             n
...################################################################################
...# EmpNo   #Id/Number  #Deptid #Departmetname                                #Pro
...#
...################################################################################

Here the number of records in Source file is dynamic.
Please help in this.

Cheers,
SRK
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to extract duplicate records with associated header record

All, I have a task to search through several hundred files and extract duplicate detail records and keep them grouped with their header record. If no duplicate detail record exists, don't pull the header. For example, an input file could look like this: input.txt HA D1 D2 D2 D3 D4 D4... (17 Replies)
Discussion started by: run_eim
17 Replies

2. Shell Programming and Scripting

Count No of Records in File without counting Header and Trailer Records

I have a flat file and need to count no of records in the file less the header and the trailer record. I would appreciate any and all asistance Thanks Hadi Lalani (2 Replies)
Discussion started by: guiguy
2 Replies

3. Shell Programming and Scripting

Renaming all header to specific header pattern

Input #HAC0253 EFVHIJHIJEFVTHIJOPKOPKTEFVEFVEFVOPKHIJOPKOPKHIJTTEFVEFVTEFV #BASFS12 EFVEFVHIJEFVEFVTOPKEFVOPKTHIJTTHIJOPK #ACG5115 TEFVEFVOIJEFVHIJHIJOPKOPKHIJHIJTTEFVEFVOPKTTEFVEFVOPKHIJOPKOPKOPK #ECG5114 IJTOPKHIJEFVOEFVEFVOPKTTEFVEFVOPKHIJOPKOPKOPK . . Output (5 Replies)
Discussion started by: patrick87
5 Replies

4. Shell Programming and Scripting

improve performance - replace $\| with $#@ and remove header and trailer records

Hi All, In my file i need to remove header and trailer records which comes in 1st line and last line respectively. After that i need to replace '$\|' with '$#@'. I am using sed command for this and its taking lot of time. Is there any other command which can be used to improve performance? ... (1 Reply)
Discussion started by: HemaV
1 Replies

5. UNIX for Dummies Questions & Answers

Grep specific records from a file of records that are separated by an empty line

Hi everyone. I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this: ID: 20 Name: X Age: 19 ID: 21 Name: Z ID: 22 Email: xxx@yahoo.com Name: Y Age: 19 I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies

6. UNIX for Dummies Questions & Answers

pull date from header and append to all records

I did some searches, but couldn't really find what I'm looking for. I have a file formatted as below: BOF ABC CO - XYZ COMM DATA OF 07/05/2011 EBA00000001 sdfa rtyus uyml EBB00000001 54682 984w3 EBA00000002 mkiyuasdf 98234 I want to pull the date from the header record and add it... (4 Replies)
Discussion started by: keeferb
4 Replies

7. 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

8. Shell Programming and Scripting

Copy header values into records

I'm using a shell script to manipulate a data file. I have a large file with two sets of data samples (tracking memory consumption) taken over a long period of time, so I have many samples. The problem is that all the data is in the same file so that each sample contains two sets of data.... (2 Replies)
Discussion started by: abercrom
2 Replies

9. Shell Programming and Scripting

Prefix a variable in the first column of all the records of the files with and without header

In a bash shell, I have to prefix a variable to two .CSV files File1.CSV and File2.CSV. One of the files has a header and the other one is with no header in the below format: "value11","value12","value13","value14","value15","value16" "value21","value22","value23","value24","value25","value26"... (7 Replies)
Discussion started by: dhruuv369
7 Replies

10. UNIX for Beginners Questions & Answers

Help in printing records where there is a 'header' in the first record ???

Hi, I have a backup report that unfortunately has some kind of hanging indent thing where the first line contains one column more than the others I managed to get the output that I wanted using awk, but just wanting to know if there is short way of doing it using the same awk Below is what... (2 Replies)
Discussion started by: newbie_01
2 Replies
POMMED(1)						      General Commands Manual							 POMMED(1)

NAME
pommed - Apple laptops hotkeys event handler SYNOPSIS
pommed [options] DESCRIPTION
This manual page documents briefly the pommed daemon. pommed is a daemon handling the hotkeys found on the Apple laptops, like the MacBook Pro, MacBook and PowerBook laptops. These hotkeys con- trol, through pommed, the LCD backlight level, the audio volume, the keyboard backlight level (only on the MacBook Pro and the latest PowerBook) and the CD/DVD drive ejection. Additionally, pommed monitors the ambient light sensors found on the MacBook Pro and the latest PowerBook to automatically light up the keyboard backlight when the ambient light level gets too low. pommed can optionally support the Apple Remote Control, too (this option is disabled by default and only available for the MacBook Pro and MacBook). OPTIONS
pommed accepts the following command-line options. -v Print version information. -f Run in the foreground, printing log messages to stdout. -d Run in the foreground, printing log messages to stdout and debug messages to stderr. FILES
/etc/pommed.conf The configuration file for pommed. See the comments in the file for the structure of the file and the available options. AUTHOR
pommed was written by Julien BLACHE <jb@jblache.org>. 2007-01-09 POMMED(1)
All times are GMT -4. The time now is 10:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy