Sponsored Content
Top Forums Shell Programming and Scripting Merge text files while combining the multiple header/trailer records into one each. Post 302259216 by oordonez on Monday 17th of November 2008 01:09:07 PM
Old 11-17-2008
Sample File

Quote:
Originally Posted by jim mcnamara
You did not give enough information to build a correct script
We need a sample header line a sample data line and a sample trailer line.
Sorry about that! Here's a sample file -- incomplete records, though, as they're rather large. But the pertinent information is contained.


BATCH HEADER PRO 0724200808042008
01E000036841 LEAD05151948F 51498 10012007 YYY
02E000036841 ME 04161988F 10012007
01E000060640 MDGV12251951F 51498 1001200709302008YYY
02E000060640 RD 05061941M 1001200709302008
01E000025850 LDUO06081956F 51498 1001200709302008YYY
02E000025850 ED 10071937M 1001200709302008
01E029009859 DUA05021960F 51498 10012007 YYY
02E029009859 LD 03101989F 10012007
02E029009859 LD 02041997M 10012007
01E034008379 AEUA09181965F 51498 10012007 YYY
02E034008379 NE 11131991F 10012007
02E034008379 RE 01131993F 10012007
02E034008379 EE 09191959M 10012007
01E045005523 EUA02131964M 51498 10012007 YNN
01E046004280 DUA12041947M 51498 10012007 YYY
02E046004280 D 12121953F 10012007
02E046004280 KE 09211986M 10012007
01E048005119 BDUA01301961F 51498 10012007 YNN
01E055002147 LDUA10011964F 51498 10012007 YYY
02E055002147 RD 11121966M 10012007
02E055002147 ND 02131997F 10012007
02E055002147 JD 03111992M 10012007
01E057008796 SEUA12061975F 51498 10012007 YYY
BATCH TRAILER 000001150000019908042008

Details on the Trailer Record: the 00000115 is a total value (number of employees), the 00000199 is the total of records processed (employees and dependents). Those two fields I'd need to keep a rolling total for all the files we merge.

The detail records are over 300 characters wide (irrelevant for what we need to do, but thought I include it).

Thank you!
 

10 More Discussions You Might Find Interesting

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

2. UNIX for Dummies Questions & Answers

Copy all the files with time stamp and remove header,trailer from file

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)
Discussion started by: ksrams
35 Replies

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

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

5. UNIX for Dummies Questions & Answers

Merge all csv files in one folder considering only 1 header row and ignoring header of all others

Friends, I need help with the following in UNIX. Merge all csv files in one folder considering only 1 header row and ignoring header of all other files. FYI - All files are in same format and contains same headers. Thank you (4 Replies)
Discussion started by: Shiny_Roy
4 Replies

6. UNIX for Dummies Questions & Answers

Need help combining txt files w/ multiple lines into csv single cell - also need data merge

:confused:Hello -- i just joined the forums. I am a complete noob -- only about 1 week into learning how to program anything... and starting with linux. I am working in Linux terminal. I have a folder with a bunch of txt files. Each file has several lines of html code. I want to combine... (2 Replies)
Discussion started by: jetsetter
2 Replies

7. Shell Programming and Scripting

Merge the multiple text files into one file

Hi All, I am trying to merge all the text files into one file using below snippet cat /home/Temp/Test/Log/*.txt >> all.txt But it seems it is not working. I have multiple files like Output_ServerName1.txt, Output_ServreName2.txt I want to merge each file into one single file and... (6 Replies)
Discussion started by: sharsour
6 Replies

8. Shell Programming and Scripting

Need to merge multiple text files vertically and place comma between fields

Hello expert friends, I'm writing a script to capture stats using sar and stuck up at report generation. I have around 10 files in a directory and need to merge them all vertically based on the time value of first column (output file should have only one time value) and insert comma after... (6 Replies)
Discussion started by: prvnrk
6 Replies

9. Shell Programming and Scripting

Merge multiple files with common header

Hi all, Say i have multiple files x1 x2 x3 x4, all with common header (date, time, year, age),, How can I merge them to one singe file "X" in shell scripting Thanks for your suggestions. (2 Replies)
Discussion started by: msarguru
2 Replies

10. UNIX for Beginners Questions & Answers

Append pipe | at the end of all the rows except header n trailer for all the files under a directory

Hi Experts Need help... I am looking for a Unix script to append pipe | at the end of all the rows (except header and trailer)in all the files placed under the directory /interfaces/Temp e.g. Header row1 row2 row3 Trailer The script should read all the files under... (3 Replies)
Discussion started by: phani333
3 Replies
PAM_FTP(8)							 Linux-PAM Manual							PAM_FTP(8)

NAME
pam_ftp - PAM module for anonymous access module SYNOPSIS
pam_ftp.so [debug] [ignore] [users=XXX,YYY,...] DESCRIPTION
pam_ftp is a PAM module which provides a pluggable anonymous ftp mode of access. This module intercepts the user's name and password. If the name is ftp or anonymous, the user's password is broken up at the @ delimiter into a PAM_RUSER and a PAM_RHOST part; these pam-items being set accordingly. The username (PAM_USER) is set to ftp. In this case the module succeeds. Alternatively, the module sets the PAM_AUTHTOK item with the entered password and fails. This module is not safe and easily spoofable. OPTIONS
debug Print debug information. ignore Pay no attention to the email address of the user (if supplied). ftp=XXX,YYY,... Instead of ftp or anonymous, provide anonymous login to the comma separated list of users: XXX,YYY,.... Should the applicant enter one of these usernames the returned username is set to the first in the list: XXX. MODULE TYPES PROVIDED
Only the auth module type is provided. RETURN VALUES
PAM_SUCCESS The authentication was successful. PAM_USER_UNKNOWN User not known. EXAMPLES
Add the following line to /etc/pam.d/ftpd to handle ftp style anonymous login: # # ftpd; add ftp-specifics. These lines enable anonymous ftp over # standard UN*X access (the listfile entry blocks access to # users listed in /etc/ftpusers) # auth sufficient pam_ftp.so auth required pam_unix.so use_first_pass auth required pam_listfile.so onerr=succeed item=user sense=deny file=/etc/ftpusers SEE ALSO
pam.conf(5), pam.d(5), pam(8) AUTHOR
pam_ftp was written by Andrew G. Morgan <morgan@kernel.org>. Linux-PAM Manual 04/01/2010 PAM_FTP(8)
All times are GMT -4. The time now is 03:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy