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
EX(4)							 BSD/i386 Kernel Interfaces Manual						     EX(4)

NAME
ex -- Ethernet device driver for the Intel EtherExpress Pro/10 and Pro/10+ SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file: device ex Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): if_ex_load="YES" DESCRIPTION
The ex driver provides support for Ethernet adapters based on the Intel i82595 chip. On the ISA bus, the card will be searched for in the I/O address range 0x200 - 0x3a0. The IRQ will be read from the EEPROM on the card. For correct operation Plug-N-Play support should be disabled. On the PC Card bus, the card will be automatically recognized and configured. HARDWARE
The ex driver supports the following Ethernet adapters: o Intel EtherExpress Pro/10 ISA o Intel EtherExpress Pro/10+ ISA o Olicom OC2220 Ethernet PC Card o Olicom OC2232 Ethernet/Modem PC Card o Silicom Ethernet LAN PC Card o Silicom EtherSerial LAN PC Card DIAGNOSTICS
ex%d: Intel EtherExpress Pro/10, address %6D, connector %s The device probe found an installed card, and was able to correctly install the device driver. ex%d: WARNING: board's EEPROM is configured for IRQ %d, using %d The device probe detected that the board is configured for a different interrupt than the one specified in the kernel configuration file. ex%d: invalid IRQ. The device probe detected an invalid IRQ setting. SEE ALSO
arp(4), netintro(4), ng_ether(4), ifconfig(8) HISTORY
The ex device driver first appeared in FreeBSD 2.2. AUTHORS
The ex device driver was written by Javier Martin Rueda. The PC Card attachment was written by Mitsuru ISAWAKI and Warner Losh. This manual page was written by David E. O'Brien. BUGS
Currently the driver does not support multicast. The Silicom EtherSerial card's serial port does not currently work. The Olicom OC2232 PC Card should work with the ex driver, but is cur- rently completely broken. BSD
July 16, 2005 BSD
All times are GMT -4. The time now is 08:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy