Cut and Merge


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Cut and Merge
# 1  
Old 07-05-2005
Cut and Merge

Hi,
I am having mulitple files with header and footer.I want to merge all the files into one file.The header in each of files is same but in the footer there are some statistics (like the total number of records) about the data in the file.
When I am going to merge all these files.I want only one header and footer for the final consolidated file. The footer of the final file should have sum of the statistics in each of the merging file.The header will be the same as is present in each of the file.
For example,The format of the file is as follows :-

****************************************
Header
****************************************









*****************************************
Statistics
Footer
*****************************************

Thanks
Tushar
# 2  
Old 07-05-2005
Quote:
Originally Posted by tushar_johri
The footer of the final file should have sum of the statistics in each of the merging file.
Without samples of the "statistics" it is impossible to help.

Cheers
ZB
# 3  
Old 07-05-2005
Hi zazzybob,
The footer has following details :-
1.Total number of records
2.Total sum calculated for all the records in the file

I hope it suffices the information required to determine the solution
Thanks and Regards
Tushar Johri
 
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using :<<cut / cut to comment out block of bash script

I am using : << cut / cut to comment out block of code. Works fine on few lines of script, then it gives me this cryptic error when I try to comment out about 80 lines. The "warning " is at last line of script. done < results 169 echo "END read all positioning parameters" 170... (8 Replies)
Discussion started by: annacreek
8 Replies

2. UNIX for Beginners Questions & Answers

Cut specific column from 2 file and merge

Hi ALL, I have two file. I need to combine these two file based on a layout. I used the below code and able to extract the record. But now able to insert that to a 3'rd file in between the extract FILE 1 CAID NUMBER 1-20 TID NUMBER 21-22 LABEL CHAR 23-44 BASE 45-60... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

3. UNIX for Beginners Questions & Answers

Cut command: can't make it cut fields

I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies

4. Shell Programming and Scripting

Cut Command error cut: Bad range

Hi Can anyone what I am doing wrong while using cut command. for f in *.log do logfilename=$f Log "Log file Name: $logfilename" logfile1=`basename $logfilename .log` flength=${#logfile1} Log "file length $flength" from_length=$(($flength - 15)) Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies
Login or Register to Ask a Question