Sample Data:
The script should validate that only 1 header and trailer exists. If more, raise exception.
The script should verify that total detail lines equal to the trailder record (Record_count)
I really appreciate if someone can provide me the script
Thanks
Moderator's Comments:
Please view this code tag video for how to use code tags when posting code and data.
All,
I am new to unix and i have the following requirement.
I have file(s) landing into input directory with timestamp, first i want to copy all these files into seperate directory then i want to rename these files without timestamp and also remove header,trailer from that file..
Could... (35 Replies)
Hi All,
I am karthik. I am new to this forum. I have one requirement.
I have a file with header and footer.
Header may be like
HDR0001
or
FILE20090110
(Assume it is unknown so far, but i am sure there is a header in the file)
likewise file has the trailer too.
I just... (7 Replies)
Hi all,
I have a requirement to create a Header &Trailer for a file which is having 20 millions of records.
If I use the following method, i think it will take more time.
cat "Header"> file1.txt
cat Data_File>>file1.txt
cat "Trailer">>file1.txt
since second CAT command has to read all... (4 Replies)
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)
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)
Hi All,
I am trying write a simple command using AWK and SED to this but without any success.
Here is what I am using:
head -1 test1.txt>test2.txt|sed '1d;$d' test1.txt|awk '{print substr($0,0,(length($0)-2))}' >>test2.txt|tail -1 test1.txt>>test2.txt
Input:
Header
1234567
abcdefgh... (2 Replies)
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)
I have a EBCDIC multi layout file which has a header record which is 21 bytes, The Detail records are 2427 bytes long and the trailer record is 9 bytes long.
Is there a command to remove the header as well as trailer record and read only the detail records while at the same time not altering... (1 Reply)
Hi All;
I am struggling to write a script that validates file header.
Header file would be like below with TAB separated
TRX # TYPE REF # Source Piece Code Destination Piece Code
every time I need to check the txt file if the header was same as above fields if validation success... (6 Replies)
Discussion started by: heye18
6 Replies
LEARN ABOUT OPENDARWIN
slapd.replog
SLAPD.REPLOG(5) File Formats Manual SLAPD.REPLOG(5)NAME
slapd.replog - slapd replication log format
SYNOPSIS
slapd.replog slapd.replog.lock
DESCRIPTION
The file slapd.replog is produced by the stand-alone LDAP daemon, slapd(8), when changes are made to its local database that are to be
propagated to one or more replica slapds. The file consists of zero or more records, each one corresponding to a change, addition, or
deletion from the slapd database. The file is meant to be read and processed by slurpd(8), the stand-alone LDAP update replication daemon.
The records are separated by a blank line. Each record has the following format.
The record begins with one or more lines indicating the replicas to which the change is to be propagated:
replica: <hostname[:portnumber]>
Next, the time the change took place given, as the number of seconds since 00:00:00 GMT, Jan. 1, 1970, with an optional decimal extension,
in order to make times unique. Note that slapd does not make times unique, but slurpd makes all times unique in its copies of the replog
files.
time: <integer[.integer]>
Next, the distinguished name of the entry being changed is given:
dn: <distinguishedname>
Next, the type of change being made is given:
changetype: <[modify|add|delete|modrdn]>
Finally, the change information itself is given, the format of which depends on what kind of change was specified above. For a changetype
of modify, the format is one or more of the following:
add: <attributetype>
<attributetype>: <value1>
<attributetype>: <value2>
...
-
Or, for a replace modification:
replace: <attributetype>
<attributetype>: <value1>
<attributetype>: <value2>
...
-
Or, for a delete modification:
delete: <attributetype>
<attributetype>: <value1>
<attributetype>: <value2>
...
-
If no attributetype lines are given, the entire attribute is to be deleted.
For a changetype of add, the format is:
<attributetype1>: <value1>
<attributetype1>: <value2>
...
<attributetypeN>: <value1>
<attributetypeN>: <value2>
For a changetype of modrdn, the format is:
newrdn: <newrdn>
deleteoldrdn: 0 | 1
where a value of 1 for deleteoldrdn means to delete the values forming the old rdn from the entry, and a value of 0 means to leave the val-
ues as non-distinguished attributes in the entry.
For a changetype of delete, no additional information is needed in the record.
The format of the values is the LDAP Directory Interchange Format described in ldif(5).
Access to the slapd.replog file is synchronized through the use of flock(3) on the file slapd.replog.lock. Any process reading or writing
this file should obey this locking convention.
EXAMPLE
The following sample slapd.replog file contains information on one of each type of change.
replica: truelies.rs.itd.umich.edu
replica: judgmentday.rs.itd.umich.edu
time: 797612941
dn: cn=Babs Jensen,dc=example,dc=com
changetype: add
objectclass: person
cn: babs
cn: babs jensen
sn: jensen
replica: truelies.rs.itd.umich.edu
replica: judgmentday.rs.itd.umich.edu
time: 797612973
dn: cn=Babs Jensen,dc=example,dc=com
changetype: modify
add: description
description: the fabulous babs
replica: truelies.rs.itd.umich.edu
replica: judgmentday.rs.itd.umich.edu
time: 797613020
dn: cn=Babs Jensen,dc=example,dc=com
changetype: modrdn
newrdn: cn=Barbara J Jensen
deleteoldrdn: 0
FILES
slapd.replog
slapd replication log file
slapd.replog.lock
lockfile for slapd.replog
SEE ALSO ldap(3), ldif(5), slapd(8), slurpd(8)ACKNOWLEDGEMENTS
OpenLDAP is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). OpenLDAP is derived from University of Michigan
LDAP 3.3 Release.
OpenLDAP 2.1.X RELEASEDATE SLAPD.REPLOG(5)