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)
$original_file->Source file
getline f->to get the header line which is appended later to all target files
$val->name of the target file (fixed part of file name stored in table Ex:XXX_YYY1)
The above command generates the target file with names XXX_YYY11, XXX_YYY12 ,�.XXX_YYY125 (I need the names to be XXX_YYY1001,�.XXX_YYY1025 )
Target files generated are XXX_YYY1001,�.XXX_YYY1025 (But I cannot fix this value since the target file names are different for 80 source files � like XXX_YYY2001�XXX_YYY2025 /XXX_YYY8001�XXX_YYY8025
Shouldn't the first source file be XXX_YYY0101.CSV
so the tenth source file can be XXX_YYY1001.CSV
and the 20th source file can be XXX_YYY2001.CSV
and the 80th source file can be XXX_YYY8001.CSV
Not sure if I understand much else, but your example naming convention is quite confusing.