Tag Archives: Requirement Need

How to Split a source file in specified format?

By mad_man12



Requirement: Need to split a source file say a1.txt which can be of size upto 150 MB into 25 target files each with a max size of 25 MB along with the header line in each target file.

NOTE: Few target files can be empty also ,but 25 files must be generated for 1 source file( I can expect upto 80 source files)

Target name format must be : XXX_YYY1001.CSV , XXX_YYY1002.CSV,…. XXX_YYY1025.CSV
for 2nd source file it must be
XXX_YYY2001…XXX_YYY2025
and so on for 80 th source file it should be
XXX_YYY8001…XXX_YYY8025


…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

How to Split a source file in specfied format?

By mad_man12



Requirement: Need to split a source file say a1.txt which can be of size upto 150 MB into 25 target files each with a max size of 25 MB along with the header line in each target file.

NOTE: Few target files can be empty also ,but 25 files must be generated for 1 source file( I can expect upto 80 source files)

Target name format must be : XXX_YYY1001.CSV , XXX_YYY1002.CSV,…. XXX_YYY1025.CSV
for 2nd source file it must be
XXX_YYY2001…XXX_YYY2025
and so on for 80 th source file it should be
XXX_YYY80001…XXX_YYY80025


…read more
Source: FULL ARTICLE at The UNIX and Linux Forums