FNR == 1 { c = 1 } - For the first record in each input file, set c to 1. { print > (f c) } - For all records, write the current record to file (f and c concatenated, e.g. $input_path/filename_1) !FNR%n { close(f c); ++c }' - if the current record number is exactly divisible by n, close the current output file and increment variable c. n=$files_per_stream f=$input_path/filename_ $input_file - set variables & input file.
1.) untill current record number is exactly divisible by n ,the filename_1 will be appended ????
This is an implicit behaviour of awk or what part of code code this ??
Yes.
Which behaviour do you mean? The second statement explicitly writes to the named file, and the third one explicitly checks FNR & changes the variable used to generate the filename.
Not/negate - if FNR%n is FALSE or zero, !FNR%n is TRUE.