Advertisement

11.28.2008 at 06:09AM PST, ID: 23942168 | Points: 200
[x]
Attachment Details

Split a large file in Unix and add header and footer

Tags:

UNIX, HP

Hi,
I would like to split a large file in Unix and add header and footer to each small files
Scenario:
1.      We receive large file with 200,00,002 lines
2.      with header line timestamp and header line 
3.      and with footer line footer| 200,00,000 
As you see file footer as got # of data lines in the file (excluding header & footer line)
Basically would like to
1.      Split the files by # of lines (user defined or passing as a parameter)
2.      Add header timestamp
3.      Add footer with # of data line count
4.      The script should count the line. (header & footer is not part of line count)

So if someone could advise me a better way to achieve this &that would be a great help
A generic function by passing parameter or some other better way
Thanks in advance

 
 
 
Expert Comment by developedtester:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by grind67:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by Tintin:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by arnold:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by grind67:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by arnold:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by ozo:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by grind67:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by grind67:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by grind67:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by arnold:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by developedtester:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
20081119-EE-VQP-45 - Hierarchy / EE_QW_2_20070628